Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [paulmckrcu:dev 82/82] kernel/rcu/rcutorture.c:2453:110: warning: format specifies type 'unsigned long' but the argument has type 'int'
@ 2025-02-11 12:37 kernel test robot
  2025-02-12 10:03 ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2025-02-11 12:37 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/paulmckrcu/linux dev
head:   31c00ec5301cf02af354d57007bf0d79d5aef1c5
commit: 31c00ec5301cf02af354d57007bf0d79d5aef1c5 [82/82] rcutorture: Check for ->up_read() without matching ->down_read()
config: i386-buildonly-randconfig-006-20250211 (https://download.01.org/0day-ci/archive/20250211/202502112058.rTKa7Z3A-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250211/202502112058.rTKa7Z3A-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/202502112058.rTKa7Z3A-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from kernel/rcu/rcutorture.c:47:
   In file included from include/linux/oom.h:10:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> kernel/rcu/rcutorture.c:2453:110: warning: format specifies type 'unsigned long' but the argument has type 'int' [-Wformat]
    2453 |         WARN_ONCE(rtorsup->rtorsu_nups >= rtorsup->rtorsu_ndowns, "%s: Up without matching down #%lu.\n", __func__, rtorsup - updownreaders);
         |                                                                                                  ~~~                ^~~~~~~~~~~~~~~~~~~~~~~
         |                                                                                                  %d
   include/asm-generic/bug.h:185:57: note: expanded from macro 'WARN_ONCE'
     185 | #define WARN_ONCE(condition, format...) WARN(condition, format)
         |                                                         ^~~~~~
   include/asm-generic/bug.h:179:12: note: expanded from macro 'WARN'
     179 |         no_printk(format);                                              \
         |                   ^~~~~~
   include/linux/printk.h:135:18: note: expanded from macro 'no_printk'
     135 |                 _printk(fmt, ##__VA_ARGS__);            \
         |                         ~~~    ^~~~~~~~~~~
   kernel/rcu/rcutorture.c:2524:111: warning: format specifies type 'unsigned long' but the argument has type 'int' [-Wformat]
    2524 |                 WARN_ONCE(rtorsup->rtorsu_nups >= rtorsup->rtorsu_ndowns, "%s: Up without matching down #%lu.\n", __func__, rtorsup - updownreaders);
         |                                                                                                          ~~~                ^~~~~~~~~~~~~~~~~~~~~~~
         |                                                                                                          %d
   include/asm-generic/bug.h:185:57: note: expanded from macro 'WARN_ONCE'
     185 | #define WARN_ONCE(condition, format...) WARN(condition, format)
         |                                                         ^~~~~~
   include/asm-generic/bug.h:179:12: note: expanded from macro 'WARN'
     179 |         no_printk(format);                                              \
         |                   ^~~~~~
   include/linux/printk.h:135:18: note: expanded from macro 'no_printk'
     135 |                 _printk(fmt, ##__VA_ARGS__);            \
         |                         ~~~    ^~~~~~~~~~~
   3 warnings generated.


vim +2453 kernel/rcu/rcutorture.c

  2446	
  2447	static enum hrtimer_restart rcu_torture_updown_hrt(struct hrtimer *hrtp)
  2448	{
  2449		struct rcu_torture_one_read_state_updown *rtorsup;
  2450	
  2451		rtorsup = container_of(hrtp, struct rcu_torture_one_read_state_updown, rtorsu_hrt);
  2452		rcu_torture_one_read_end(&rtorsup->rtorsu_rtors, &rtorsup->rtorsu_trs, -1);
> 2453		WARN_ONCE(rtorsup->rtorsu_nups >= rtorsup->rtorsu_ndowns, "%s: Up without matching down #%lu.\n", __func__, rtorsup - updownreaders);
  2454		rtorsup->rtorsu_nups++;
  2455		smp_store_release(&rtorsup->rtorsu_inuse, false);
  2456		return HRTIMER_NORESTART;
  2457	}
  2458	

-- 
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:[~2025-02-13  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11 12:37 [paulmckrcu:dev 82/82] kernel/rcu/rcutorture.c:2453:110: warning: format specifies type 'unsigned long' but the argument has type 'int' kernel test robot
2025-02-12 10:03 ` Paul E. McKenney
2025-02-13  5:51   ` Oliver Sang
2025-02-13  7:56     ` 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