qed: reduce maximum stack frame size
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Jul 2019 15:01:23 +0000 (17:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jul 2019 22:46:11 +0000 (15:46 -0700)
commit7c116e02a4a7575c8c62bfd2106e3e3ec8fb99dc
tree6313d945feb6b0d9510f775b3e848f5be3d58441
parent81cd17a4121d7dc7cad28e51251f31ff12b1de2b
qed: reduce maximum stack frame size

clang warns about an overly large stack frame in one function
when it decides to inline all __qed_get_vport_*() functions into
__qed_get_vport_stats():

drivers/net/ethernet/qlogic/qed/qed_l2.c:1889:13: error: stack frame size of 1128 bytes in function '_qed_get_vport_stats' [-Werror,-Wframe-larger-than=]

Use a noinline_for_stack annotation to prevent clang from inlining
these, which keeps the maximum stack usage at around half of that
in the worst case, similar to what we get with gcc.

Fixes: 86622ee75312 ("qed: Move statistics to L2 code")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_l2.c