]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vme: bridges: reduce stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 7 Jan 2020 20:05:43 +0000 (21:05 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:50:10 +0000 (10:50 +0200)
commit20f60aba5989b66d69be49ed5c5900d38389fc87
tree3082f15f84f0ca30755a07fa04c2fcf77c75c27a
parentb52be79f3c6cc89bb3834c5174843e34f945f386
vme: bridges: reduce stack usage

BugLink: https://bugs.launchpad.net/bugs/1867837
[ Upstream commit 7483e7a939c074d887450ef1c4d9ccc5909405f8 ]

With CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3, the stack usage in vme_fake
grows above the warning limit:

drivers/vme/bridges/vme_fake.c: In function 'fake_master_read':
drivers/vme/bridges/vme_fake.c:610:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
drivers/vme/bridges/vme_fake.c: In function 'fake_master_write':
drivers/vme/bridges/vme_fake.c:797:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

The problem is that in some configurations, each call to
fake_vmereadX() puts another variable on the stack.

Reduce the amount of inlining to get back to the previous state,
with no function using more than 200 bytes each.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200107200610.3482901-1-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/vme/bridges/vme_fake.c