This is a note to let you know that I've just added the patch titled parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers to the 5.10-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: parisc-avoid-a-warning-on-u8-cast-for-cmpxchg-on-u8-pointers.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4d752e5af63753ab5140fc282929b98eaa4bd12e Mon Sep 17 00:00:00 2001 From: Gao Xiang <hsiangkao@xxxxxxxxxx> Date: Tue, 6 Apr 2021 12:59:29 +0800 Subject: parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers From: Gao Xiang <hsiangkao@xxxxxxxxxx> commit 4d752e5af63753ab5140fc282929b98eaa4bd12e upstream. commit b344d6a83d01 ("parisc: add support for cmpxchg on u8 pointers") can generate a sparse warning ("cast truncates bits from constant value"), which has been reported several times [1] [2] [3]. The original code worked as expected, but anyway, let silence such sparse warning as what others did [4]. [1] https://lore.kernel.org/r/202104061220.nRMBwCXw-lkp@xxxxxxxxx [2] https://lore.kernel.org/r/202012291914.T5Agcn99-lkp@xxxxxxxxx [3] https://lore.kernel.org/r/202008210829.KVwn7Xeh%25lkp@xxxxxxxxx [4] https://lore.kernel.org/r/20210315131512.133720-2-jacopo+renesas@xxxxxxxxxx Cc: Liam Beguin <liambeguin@xxxxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v5.8+ Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxx> Signed-off-by: Helge Deller <deller@xxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/parisc/include/asm/cmpxchg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/parisc/include/asm/cmpxchg.h +++ b/arch/parisc/include/asm/cmpxchg.h @@ -72,7 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned l #endif case 4: return __cmpxchg_u32((unsigned int *)ptr, (unsigned int)old, (unsigned int)new_); - case 1: return __cmpxchg_u8((u8 *)ptr, (u8)old, (u8)new_); + case 1: return __cmpxchg_u8((u8 *)ptr, old & 0xff, new_ & 0xff); } __cmpxchg_called_with_bad_pointer(); return old; Patches currently in stable-queue which might be from hsiangkao@xxxxxxxxxx are queue-5.10/parisc-avoid-a-warning-on-u8-cast-for-cmpxchg-on-u8-pointers.patch