All of lore.kernel.org
 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
Subject: [paulmckrcu:dev 29/32] kernel/rcu/srcutree.c:779:46: error: 'idx' undeclared; did you mean 'ida'?
Date: Sun, 22 Dec 2024 02:56:22 +0800	[thread overview]
Message-ID: <202412220224.7NlsDpAF-lkp@intel.com> (raw)

tree:   https://github.com/paulmckrcu/linux dev
head:   61a0b92b3a3cfef69e3848806e51d1b99a9e9406
commit: 2d83ec26a0f96c719fdc81b54f75d7b924dcd6bf [29/32] srcu: Make SRCU readers use ->srcu_ctrs for counter selection
config: sparc-randconfig-002-20241221 (https://download.01.org/0day-ci/archive/20241222/202412220224.7NlsDpAF-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241222/202412220224.7NlsDpAF-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/202412220224.7NlsDpAF-lkp@intel.com/

All errors (new ones prefixed by >>):

   kernel/rcu/srcutree.c: In function '__srcu_read_lock_nmisafe':
>> kernel/rcu/srcutree.c:779:46: error: 'idx' undeclared (first use in this function); did you mean 'ida'?
     779 |         atomic_long_inc(&ssp->sda->srcu_ctrs[idx].srcu_locks.counter);
         |                                              ^~~
         |                                              ida
   kernel/rcu/srcutree.c:779:46: note: each undeclared identifier is reported only once for each function it appears in
   kernel/rcu/srcutree.c:777:27: warning: unused variable 'sdp' [-Wunused-variable]
     777 |         struct srcu_data *sdp = raw_cpu_ptr(ssp->sda);
         |                           ^~~
   kernel/rcu/srcutree.c: In function '__srcu_read_unlock_nmisafe':
   kernel/rcu/srcutree.c:795:25: error: passing argument 1 of 'atomic_long_inc' from incompatible pointer type [-Wincompatible-pointer-types]
     795 |         atomic_long_inc(&sdp->srcu_ctrs[idx].srcu_unlocks.counter);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                         |
         |                         s64 * {aka long long int *}
   In file included from include/linux/atomic.h:82,
                    from include/asm-generic/bitops/lock.h:5,
                    from arch/sparc/include/asm/bitops_64.h:52,
                    from arch/sparc/include/asm/bitops.h:5,
                    from include/linux/bitops.h:68,
                    from include/linux/thread_info.h:27,
                    from arch/sparc/include/asm/current.h:15,
                    from include/linux/mutex.h:14,
                    from kernel/rcu/srcutree.c:19:
   include/linux/atomic/atomic-instrumented.h:3589:32: note: expected 'atomic_long_t *' {aka 'atomic64_t *'} but argument is of type 's64 *' {aka 'long long int *'}
    3589 | atomic_long_inc(atomic_long_t *v)
         |                 ~~~~~~~~~~~~~~~^


vim +779 kernel/rcu/srcutree.c

   768	
   769	/*
   770	 * Counts the new reader in the appropriate per-CPU element of the
   771	 * srcu_struct, but in an NMI-safe manner using RMW atomics.
   772	 * Returns an index that must be passed to the matching srcu_read_unlock().
   773	 */
   774	int __srcu_read_lock_nmisafe(struct srcu_struct *ssp)
   775	{
   776		struct srcu_ctr *scp = READ_ONCE(ssp->srcu_ctrp);
   777		struct srcu_data *sdp = raw_cpu_ptr(ssp->sda);
   778	
 > 779		atomic_long_inc(&ssp->sda->srcu_ctrs[idx].srcu_locks.counter);
   780		smp_mb__after_atomic(); /* B */  /* Avoid leaking the critical section. */
   781		return scp - &ssp->sda->srcu_ctrs[0];
   782	}
   783	EXPORT_SYMBOL_GPL(__srcu_read_lock_nmisafe);
   784	

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

                 reply	other threads:[~2024-12-21 18:56 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 \
    --in-reply-to=202412220224.7NlsDpAF-lkp@intel.com \
    --to=lkp@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.