sf: Avoid allocating memory on every read operation
authorSimon Glass <sjg@chromium.org>
Mon, 1 Oct 2018 18:22:09 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Oct 2018 10:40:27 +0000 (04:40 -0600)
commit97f57109bb750d0b2908d6ecd4aef3801baf1cf2
treedf5e1506785829d0db8920625dee12e849106df7
parente6c5c94a79d9e1dd20f869a3169bf2be00d53d14
sf: Avoid allocating memory on every read operation

At present spi_flash_cmd_read_ops() allocates and frees a few bytes of
memory every time it is called. It is faster to use the stack for this
and this is now supported by the minimum GCC version required by U-Boot.

Remove the allocation and use a variable-sized array instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/mtd/spi/spi_flash.c