arch/x86/include/asm/atomic64_32.h:110:34: sparse: sparse: cast truncates bits from constant value (100000001 becomes 1)

From: kernel test robot
Date: Mon Jan 23 2023 - 10:07:20 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2475bf0250dee99b477e0c56d7dc9d7ac3f04117
commit: 5d7edbc9231ec6b60f9c5b7e7980e9a1cd92e6bb rxrpc: Get rid of the Rx ring
date: 3 months ago
config: i386-randconfig-s003-20230123 (https://download.01.org/0day-ci/archive/20230123/202301232313.i8GVDJuq-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5d7edbc9231ec6b60f9c5b7e7980e9a1cd92e6bb
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 5d7edbc9231ec6b60f9c5b7e7980e9a1cd92e6bb
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 olddefconfig
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash net/rxrpc/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>

sparse warnings: (new ones prefixed by >>)
net/rxrpc/call_object.c: note: in included file (through arch/x86/include/asm/atomic.h, include/linux/atomic.h, include/linux/cpumask.h, ...):
>> arch/x86/include/asm/atomic64_32.h:110:34: sparse: sparse: cast truncates bits from constant value (100000001 becomes 1)

vim +110 arch/x86/include/asm/atomic64_32.h

1a3b1d89eded68 Brian Gerst 2010-01-07 99
1a3b1d89eded68 Brian Gerst 2010-01-07 100 /**
8bf705d130396e Dmitry Vyukov 2018-01-29 101 * arch_atomic64_set - set atomic64 variable
a7e926abc3adfb Luca Barbieri 2010-02-24 102 * @v: pointer to type atomic64_t
1f0459780c2849 Philipp Hahn 2012-05-02 103 * @i: value to assign
1a3b1d89eded68 Brian Gerst 2010-01-07 104 *
a7e926abc3adfb Luca Barbieri 2010-02-24 105 * Atomically sets the value of @v to @n.
1a3b1d89eded68 Brian Gerst 2010-01-07 106 */
79c53a83d7a31a Mark Rutland 2019-05-22 107 static inline void arch_atomic64_set(atomic64_t *v, s64 i)
a7e926abc3adfb Luca Barbieri 2010-02-24 108 {
a7e926abc3adfb Luca Barbieri 2010-02-24 109 unsigned high = (unsigned)(i >> 32);
a7e926abc3adfb Luca Barbieri 2010-02-24 @110 unsigned low = (unsigned)i;
819165fb34b977 Jan Beulich 2012-01-20 111 alternative_atomic64(set, /* no output */,
819165fb34b977 Jan Beulich 2012-01-20 112 "S" (v), "b" (low), "c" (high)
819165fb34b977 Jan Beulich 2012-01-20 113 : "eax", "edx", "memory");
a7e926abc3adfb Luca Barbieri 2010-02-24 114 }
1a3b1d89eded68 Brian Gerst 2010-01-07 115

:::::: The code at line 110 was first introduced by commit
:::::: a7e926abc3adfbd2e5e20d2b46177adb4e313915 x86-32: Rewrite 32-bit atomic64 functions in assembly

:::::: TO: Luca Barbieri <luca@xxxxxxxxxxxxxxxxx>
:::::: CC: H. Peter Anvin <hpa@xxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests