[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220520194659.2356903-1-kuba@kernel.org>
Date: Fri, 20 May 2022 12:46:59 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: mkl@...gutronix.de
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, Jakub Kicinski <kuba@...nel.org>,
wg@...ndegger.com, linux-can@...r.kernel.org
Subject: [PATCH net-next] can: kvaser_usb: silence a GCC 12 -Warray-bounds warning
This driver does a lot of casting of smaller buffers to
struct kvaser_cmd_ext, GCC 12 does not like that:
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c:489:65: warning: array subscript ‘struct kvaser_cmd_ext[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Warray-bounds]
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c:489:23: note: in expansion of macro ‘le16_to_cpu’
489 | ret = le16_to_cpu(((struct kvaser_cmd_ext *)cmd)->len);
| ^~~~~~~~~~~
Temporarily silence this warning (move it to W=1 builds).
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
Hi Marc, are you planning another -next PR? Can we take this
directly?
CC: wg@...ndegger.com
CC: mkl@...gutronix.de
CC: linux-can@...r.kernel.org
---
drivers/net/can/usb/kvaser_usb/Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/can/usb/kvaser_usb/Makefile b/drivers/net/can/usb/kvaser_usb/Makefile
index cf260044f0b9..b20d951a0790 100644
--- a/drivers/net/can/usb/kvaser_usb/Makefile
+++ b/drivers/net/can/usb/kvaser_usb/Makefile
@@ -1,3 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
kvaser_usb-y = kvaser_usb_core.o kvaser_usb_leaf.o kvaser_usb_hydra.o
+
+# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
+ifndef KBUILD_EXTRA_WARN
+CFLAGS_kvaser_usb_hydra.o += -Wno-array-bounds
+endif
--
2.34.3
Powered by blists - more mailing lists