ethtool: reduce stack usage with clang
authorArnd Bergmann <arnd@arndb.de>
Thu, 7 Mar 2019 15:58:35 +0000 (16:58 +0100)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Tue, 11 Jun 2019 00:35:55 +0000 (09:35 +0900)
commitd7f84f7b0c7a470755affc7fb6657d3fff2fdd22
treeba9d98d87dd147689c8cda6d0919995266d36657
parent49b7baff2dc76c68ffd9fdd5962e428b3de5fb3a
ethtool: reduce stack usage with clang

clang inlines the dev_ethtool() more aggressively than gcc does, leading
to a larger amount of used stack space:

net/core/ethtool.c:2536:24: error: stack frame size of 1216 bytes in function 'dev_ethtool' [-Werror,-Wframe-larger-than=]

Marking the sub-functions that require the most stack space as
noinline_for_stack gives us reasonable behavior on all compilers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
[sw0312.kim: cherry-pick mainline commit 3499e87ea041 to remove frame-larger-than build warning with llvm/clang]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I99a8ba2db0d81a6181096ef649531e7d3fcaf3eb
net/core/ethtool.c