net: microchip: sparx5: reduce stack usage
authorArnd Bergmann <arnd@arndb.de>
Fri, 17 Feb 2023 09:58:06 +0000 (10:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Feb 2023 10:50:47 +0000 (10:50 +0000)
commit129ff4de58ff0ca981b833834d8b9bddb71d4bfe
treee3d968a1018152c2ef8e07af5ad921faa2d29070
parenta59f832a71c938779b8abdb022d6d39903e635c3
net: microchip: sparx5: reduce stack usage

The vcap_admin structures in vcap_api_next_lookup_advanced_test()
take several hundred bytes of stack frame, but when CONFIG_KASAN_STACK
is enabled, each one of them also has extra padding before and after
it, which ends up blowing the warning limit:

In file included from drivers/net/ethernet/microchip/vcap/vcap_api.c:3521:
drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c: In function 'vcap_api_next_lookup_advanced_test':
drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:1954:1: error: the frame size of 1448 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]
 1954 | }

Reduce the total stack usage by replacing the five structures with
an array that only needs one pair of padding areas.

Fixes: 1f741f001160 ("net: microchip: sparx5: Add KUNIT tests for enabling/disabling chains")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c