cmd: rng: Use a statically allocated array for random bytes
authorSughosh Ganu <sughosh.ganu@linaro.org>
Fri, 22 Jul 2022 16:02:07 +0000 (21:32 +0530)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 2 Aug 2022 20:50:02 +0000 (23:50 +0300)
commitc79e274c7c6637eeaf631988b18dd68a30596778
tree0bee8c92ee2c645f415dc5cf5f8e5126ad341918
parent87ab234c1cf42a38655b4f93d0dc399b9a9561fa
cmd: rng: Use a statically allocated array for random bytes

Use a statically allocated buffer on stack instead of using malloc for
reading the random bytes. Using a local array is faster than
allocating heap memory on every initiation of the command.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
cmd/rng.c