]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: carl9170: silence a GCC 12 -Warray-bounds warning
authorJakub Kicinski <kuba@kernel.org>
Fri, 20 May 2022 19:43:20 +0000 (12:43 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 23 May 2022 00:23:15 +0000 (17:23 -0700)
commitfd610dc3b49cd1b716899a67f1cd5d211ef68955
tree8a459b2cc54cd5a169a0daec3123ac0356a5f9c6
parent0e3103dd55044bbc63685eec9e6de109b8f1beb3
wifi: carl9170: silence a GCC 12 -Warray-bounds warning

carl9170 has a big union (struct carl9170_cmd) with all the command
types in it. But it allocates buffers only large enough for a given
command. This upsets GCC 12:

drivers/net/wireless/ath/carl9170/cmd.c:125:30: warning: array subscript ‘struct carl9170_cmd[0]’ is partly outside array bounds of ‘unsigned char[8]’ [-Warray-bounds]
  125 |                 tmp->hdr.cmd = cmd;
      |                 ~~~~~~~~~~~~~^~~~~

Punt the warning to W=1 for now. Hopefully GCC will learn to
recognize which fields are in-bounds.

Acked-by: Christian Lamparter <chunkeey@gmail.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wireless/ath/carl9170/Makefile