mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [paulmck-rcu:dev.2024.03.27b 61/69] lib/cmpxchg-emu.c:24:11: warning: no previous prototype for 'cmpxchg_emu_u8'
@ 2024-03-29 21:26 kernel test robot
  2024-03-29 23:08 ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2024-03-29 21:26 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: oe-kbuild-all, linux-kernel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.03.27b
head:   786fab3085d764055a78edb54023420920344333
commit: b48ffed4c636b96d2be7a93806870772ce34961f [61/69] csky: Emulate one-byte and two-byte cmpxchg
config: csky-allnoconfig (https://download.01.org/0day-ci/archive/20240330/202403300508.Xz7XNp71-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240330/202403300508.Xz7XNp71-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403300508.Xz7XNp71-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/cmpxchg-emu.c:24:11: warning: no previous prototype for 'cmpxchg_emu_u8' [-Wmissing-prototypes]
      24 | uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new)
         |           ^~~~~~~~~~~~~~
>> lib/cmpxchg-emu.c:51:11: warning: no previous prototype for 'cmpxchg_emu_u16' [-Wmissing-prototypes]
      51 | uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new)
         |           ^~~~~~~~~~~~~~~


vim +/cmpxchg_emu_u8 +24 lib/cmpxchg-emu.c

0bbce967f3ecfc Paul E. McKenney 2024-03-17  22  
0bbce967f3ecfc Paul E. McKenney 2024-03-17  23  /* Emulate one-byte cmpxchg() in terms of 4-byte cmpxchg. */
0bbce967f3ecfc Paul E. McKenney 2024-03-17 @24  uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new)
0bbce967f3ecfc Paul E. McKenney 2024-03-17  25  {
0bbce967f3ecfc Paul E. McKenney 2024-03-17  26  	u32 *p32 = (u32 *)(((uintptr_t)p) & ~0x3);
0bbce967f3ecfc Paul E. McKenney 2024-03-17  27  	int i = ((uintptr_t)p) & 0x3;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  28  	union u8_32 old32;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  29  	union u8_32 new32;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  30  	u32 ret;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  31  
0bbce967f3ecfc Paul E. McKenney 2024-03-17  32  	old32.w = READ_ONCE(*p32);
0bbce967f3ecfc Paul E. McKenney 2024-03-17  33  	do {
0bbce967f3ecfc Paul E. McKenney 2024-03-17  34  		if (old32.b[i] != old)
0bbce967f3ecfc Paul E. McKenney 2024-03-17  35  			return old32.b[i];
0bbce967f3ecfc Paul E. McKenney 2024-03-17  36  		new32.w = old32.w;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  37  		new32.b[i] = new;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  38  		instrument_atomic_read_write(p, 1);
0bbce967f3ecfc Paul E. McKenney 2024-03-17  39  		ret = data_race(cmpxchg(p32, old32.w, new32.w));
0bbce967f3ecfc Paul E. McKenney 2024-03-17  40  	} while (ret != old32.w);
0bbce967f3ecfc Paul E. McKenney 2024-03-17  41  	return old;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  42  }
0bbce967f3ecfc Paul E. McKenney 2024-03-17  43  EXPORT_SYMBOL_GPL(cmpxchg_emu_u8);
0bbce967f3ecfc Paul E. McKenney 2024-03-17  44  
0bbce967f3ecfc Paul E. McKenney 2024-03-17  45  union u16_32 {
0bbce967f3ecfc Paul E. McKenney 2024-03-17  46  	u16 h[2];
0bbce967f3ecfc Paul E. McKenney 2024-03-17  47  	u32 w;
0bbce967f3ecfc Paul E. McKenney 2024-03-17  48  };
0bbce967f3ecfc Paul E. McKenney 2024-03-17  49  
0bbce967f3ecfc Paul E. McKenney 2024-03-17  50  /* Emulate two-byte cmpxchg() in terms of 4-byte cmpxchg. */
0bbce967f3ecfc Paul E. McKenney 2024-03-17 @51  uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new)

:::::: The code at line 24 was first introduced by commit
:::::: 0bbce967f3ecfc6da1e7e8756b0d398e791b8dee lib: Add one-byte and two-byte cmpxchg() emulation functions

:::::: TO: Paul E. McKenney <paulmck@kernel.org>
:::::: CC: Paul E. McKenney <paulmck@kernel.org>

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

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

end of thread, other threads:[~2024-03-31 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-29 21:26 [paulmck-rcu:dev.2024.03.27b 61/69] lib/cmpxchg-emu.c:24:11: warning: no previous prototype for 'cmpxchg_emu_u8' kernel test robot
2024-03-29 23:08 ` Paul E. McKenney
2024-03-31 16:06   ` Yujie Liu
2024-03-31 18:40     ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®