stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Patch "can: ti_hecc: fix -Woverflow compiler warning" has been added to the 6.15-stable tree
       [not found] <20250817134901.2350637-1-sashal@kernel.org>
@ 2025-08-18  3:54 ` Vincent Mailhol
  2025-08-22  8:21   ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Mailhol @ 2025-08-18  3:54 UTC (permalink / raw)
  To: stable; +Cc: stable-commits, Marc Kleine-Budde

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;a=summary
>
> 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 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch "can: ti_hecc: fix -Woverflow compiler warning" has been added to the 6.15-stable tree
  2025-08-18  3:54 ` Patch "can: ti_hecc: fix -Woverflow compiler warning" has been added to the 6.15-stable tree Vincent Mailhol
@ 2025-08-22  8:21   ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2025-08-22  8:21 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: stable, stable-commits, Marc Kleine-Budde

On Mon, Aug 18, 2025 at 12:54:26PM +0900, Vincent Mailhol wrote:
> 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;a=summary
> >
> > 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.

Oops, missed this, it broke the build, as you point out, so I'll go drop
it from all older kernels and revert it in 6.12.y now.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-22  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250817134901.2350637-1-sashal@kernel.org>
2025-08-18  3:54 ` Patch "can: ti_hecc: fix -Woverflow compiler warning" has been added to the 6.15-stable tree Vincent Mailhol
2025-08-22  8:21   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).