]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: cfi: reduce stack size
authorArnd Bergmann <arnd@arndb.de>
Tue, 10 Mar 2015 16:48:37 +0000 (17:48 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 11 Mar 2015 22:25:51 +0000 (15:25 -0700)
commitdcde240ac0264517da2a34e296635d1b62e6f978
tree602b75077556ad1630304dfa3d081a69feaecc4f
parent7dccd63bed5d2dca348ba26d8b7400f8cba3d6b7
mtd: cfi: reduce stack size

The cfi_staa_write_buffers function uses a large amount of kernel stack
whenever CONFIG_MTD_MAP_BANK_WIDTH_32 is set, and that results in a
warning on ARM allmodconfig builds:

drivers/mtd/chips/cfi_cmdset_0020.c: In function 'cfi_staa_write_buffers':
drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]

It turns out that this is largely a result of a suboptimal implementation
of map_word_andequal(). Replacing this function with a straightforward
one reduces the stack size in this function by exactly 200 bytes,
shrinks the .text segment for this file from 27648 bytes to 26608 bytes,
and makes the warning go away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
include/linux/mtd/map.h