From: kernel test robot <[email protected]>
To: David Howells <[email protected]>
Cc: [email protected],
GNU/Weeb Mailing List <[email protected]>,
[email protected]
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)
Date: Sat, 26 Mar 2022 09:50:50 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
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/[email protected]/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 <[email protected]>
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 <[email protected]>
:::::: CC: David Howells <[email protected]>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-03-26 1:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox