[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202203260941.OiKX28fM-lkp@intel.com>
Date: Sat, 26 Mar 2022 09:50:50 +0800
From: kernel test robot <lkp@...el.com>
To: David Howells <dhowells@...hat.com>
Cc: kbuild-all@...ts.01.org,
GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
linux-kernel@...r.kernel.org
Subject: [ammarfaizi2-block:dhowells/linux-fs/afs-testing 44/44]
include/asm-generic/cmpxchg.h:35:39: sparse: sparse: cast truncates bits
from constant value (5e5ee5e5 becomes e5)
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/afs-testing
head: 1eba43e7cea9100a3767c5a7212ec5f1db4db4fd
commit: 1eba43e7cea9100a3767c5a7212ec5f1db4db4fd [44/44] Check for dead timer
config: nios2-randconfig-s032-20220324 (https://download.01.org/0day-ci/archive/20220326/202203260941.OiKX28fM-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/ammarfaizi2/linux-block/commit/1eba43e7cea9100a3767c5a7212ec5f1db4db4fd
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/afs-testing
git checkout 1eba43e7cea9100a3767c5a7212ec5f1db4db4fd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash kernel/time/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
kernel/time/timer.c: note: in included file (through arch/nios2/include/generated/asm/cmpxchg.h, include/asm-generic/atomic.h, arch/nios2/include/generated/asm/atomic.h, ...):
>> include/asm-generic/cmpxchg.h:35:39: sparse: sparse: cast truncates bits from constant value (5e5ee5e5 becomes e5)
>> include/asm-generic/cmpxchg.h:46:40: sparse: sparse: cast truncates bits from constant value (5e5ee5e5 becomes e5e5)
vim +35 include/asm-generic/cmpxchg.h
b4816afa3986704 David Howells 2012-03-28 22
b4816afa3986704 David Howells 2012-03-28 23 static inline
82b993e8249ae3c Mark Rutland 2021-05-25 24 unsigned long __generic_xchg(unsigned long x, volatile void *ptr, int size)
b4816afa3986704 David Howells 2012-03-28 25 {
b4816afa3986704 David Howells 2012-03-28 26 unsigned long ret, flags;
b4816afa3986704 David Howells 2012-03-28 27
b4816afa3986704 David Howells 2012-03-28 28 switch (size) {
b4816afa3986704 David Howells 2012-03-28 29 case 1:
b4816afa3986704 David Howells 2012-03-28 30 #ifdef __xchg_u8
b4816afa3986704 David Howells 2012-03-28 31 return __xchg_u8(x, ptr);
b4816afa3986704 David Howells 2012-03-28 32 #else
b4816afa3986704 David Howells 2012-03-28 33 local_irq_save(flags);
b4816afa3986704 David Howells 2012-03-28 34 ret = *(volatile u8 *)ptr;
b4816afa3986704 David Howells 2012-03-28 @35 *(volatile u8 *)ptr = x;
b4816afa3986704 David Howells 2012-03-28 36 local_irq_restore(flags);
b4816afa3986704 David Howells 2012-03-28 37 return ret;
b4816afa3986704 David Howells 2012-03-28 38 #endif /* __xchg_u8 */
b4816afa3986704 David Howells 2012-03-28 39
b4816afa3986704 David Howells 2012-03-28 40 case 2:
b4816afa3986704 David Howells 2012-03-28 41 #ifdef __xchg_u16
b4816afa3986704 David Howells 2012-03-28 42 return __xchg_u16(x, ptr);
b4816afa3986704 David Howells 2012-03-28 43 #else
b4816afa3986704 David Howells 2012-03-28 44 local_irq_save(flags);
b4816afa3986704 David Howells 2012-03-28 45 ret = *(volatile u16 *)ptr;
b4816afa3986704 David Howells 2012-03-28 @46 *(volatile u16 *)ptr = x;
b4816afa3986704 David Howells 2012-03-28 47 local_irq_restore(flags);
b4816afa3986704 David Howells 2012-03-28 48 return ret;
b4816afa3986704 David Howells 2012-03-28 49 #endif /* __xchg_u16 */
b4816afa3986704 David Howells 2012-03-28 50
b4816afa3986704 David Howells 2012-03-28 51 case 4:
b4816afa3986704 David Howells 2012-03-28 52 #ifdef __xchg_u32
b4816afa3986704 David Howells 2012-03-28 53 return __xchg_u32(x, ptr);
b4816afa3986704 David Howells 2012-03-28 54 #else
b4816afa3986704 David Howells 2012-03-28 55 local_irq_save(flags);
b4816afa3986704 David Howells 2012-03-28 56 ret = *(volatile u32 *)ptr;
b4816afa3986704 David Howells 2012-03-28 57 *(volatile u32 *)ptr = x;
b4816afa3986704 David Howells 2012-03-28 58 local_irq_restore(flags);
b4816afa3986704 David Howells 2012-03-28 59 return ret;
b4816afa3986704 David Howells 2012-03-28 60 #endif /* __xchg_u32 */
b4816afa3986704 David Howells 2012-03-28 61
:::::: The code at line 35 was first introduced by commit
:::::: b4816afa3986704d1404fc48e931da5135820472 Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
:::::: TO: David Howells <dhowells@...hat.com>
:::::: CC: David Howells <dhowells@...hat.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists