mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [paulmck-rcu:dev.2024.03.27b 61/69] lib/cmpxchg-emu.c:24:11: warning: no previous prototype for 'cmpxchg_emu_u8'
Date: Sat, 30 Mar 2024 05:26:12 +0800	[thread overview]
Message-ID: <202403300508.Xz7XNp71-lkp@intel.com> (raw)

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

             reply	other threads:[~2024-03-29 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 21:26 kernel test robot [this message]
2024-03-29 23:08 ` Paul E. McKenney
2024-03-31 16:06   ` Yujie Liu
2024-03-31 18:40     ` Paul E. McKenney

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 \
    --in-reply-to=202403300508.Xz7XNp71-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paulmck@kernel.org \
    /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

all inboxes | Powered by JetHome®