Hi Sasha,
On Sun. 17 Aug. 2025 at 22:49, Sasha Levin sashal@kernel.org wrote:
This is a note to let you know that I've just added the patch titled
can: ti_hecc: fix -Woverflow compiler warning
to the 6.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: can-ti_hecc-fix-woverflow-compiler-warning.patch and it can be found in the queue-6.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
This only silences a compiler warning. There are no actual bugs in the original code. This is why I did not put the Fixes tag.
I am not against this being backported to stable but please note that this depends on the new BIT_U32() macro which where recently added in commit 5b572e8a9f3d ("bits: introduce fixed-type BIT_U*()") Link: https://git.kernel.org/torvalds/c/5b572e8a9f3d
So, unless you also backport the above patch, this will not compile.
The options are:
1. drop this patch (i.e. keep that benin -Woverflow in stable) 2. backport the new BIT_U*() macros and keep the patch as-is 3. modify the patch as below:
mbx_mask = ~(u32)BIT(HECC_RX_LAST_MBOX);
I'll let you decide what you prefer. That comment also applies to the other backports of that patch except for the 6.16.x branch which already has the BIT_U*() macros.
Yours sincerely, Vincent Mailhol
commit f37dbcbbea3844900081b44f372f2f4d4be1b5c6 Author: Vincent Mailhol mailhol.vincent@wanadoo.fr Date: Tue Jul 15 20:28:11 2025 +0900
can: ti_hecc: fix -Woverflow compiler warning [ Upstream commit 7cae4d04717b002cffe41169da3f239c845a0723 ] Fix below default (W=0) warning: drivers/net/can/ti_hecc.c: In function 'ti_hecc_start': drivers/net/can/ti_hecc.c:386:20: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744073709551599' to '4294967279' [-Woverflow] 386 | mbx_mask = ~BIT(HECC_RX_LAST_MBOX); | ^ Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://patch.msgid.link/20250715-can-compile-test-v2-1-f7fd566db86f@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c index 644e8b8eb91e..e6d6661a908a 100644 --- a/drivers/net/can/ti_hecc.c +++ b/drivers/net/can/ti_hecc.c @@ -383,7 +383,7 @@ static void ti_hecc_start(struct net_device *ndev) * overflows instead of the hardware silently dropping the * messages. */
mbx_mask = ~BIT(HECC_RX_LAST_MBOX);
mbx_mask = ~BIT_U32(HECC_RX_LAST_MBOX); hecc_write(priv, HECC_CANOPC, mbx_mask); /* Enable interrupts */
linux-stable-mirror@lists.linaro.org