Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [jpoimboe:sframe-2.1 5/5] kernel/unwind/user.c:179:19: warning: shift count >= width of type
@ 2024-09-17 13:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-17 13:10 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git sframe-2.1
head:   5b35eb7c617539f21cbe3764b0ee0c77567b0f22
commit: 5b35eb7c617539f21cbe3764b0ee0c77567b0f22 [5/5] unwind: Add deferred interfaces
config: i386-defconfig (https://download.01.org/0day-ci/archive/20240917/202409172133.Uqcuvsht-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240917/202409172133.Uqcuvsht-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/202409172133.Uqcuvsht-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/unwind/user.c:179:19: warning: shift count >= width of type [-Wshift-count-overflow]
     179 |                 cookie &= ((1UL << 48) - 1);
         |                                 ^  ~~
   1 warning generated.


vim +179 kernel/unwind/user.c

   165	
   166	{
   167		BUILD_BUG_ON(NR_CPUS > 65535);
   168	
   169		if (WARN_ON_ONCE(in_nmi()))
   170			return -EINVAL;
   171	
   172		local_irq_disable();
   173	
   174		if (!current->unwind_ctx_cookie) {
   175			u64 cpu = smp_processor_id();
   176			u64 cookie;
   177	
   178			cookie = __this_cpu_read(ctx_ctr);
 > 179			cookie &= ((1UL << 48) - 1);
   180			cookie |= ((cpu << 48) + 1);
   181			__this_cpu_write(ctx_ctr, cookie);
   182	
   183			current->unwind_ctx_cookie = cookie;
   184			task_work_add(current, &current->unwind_work, TWA_RESUME);
   185		}
   186	
   187		*ctx_cookie = current->unwind_ctx_cookie;
   188		current->unwind_pending |= (1 << callback->unwind_priv.idx);
   189	
   190		local_irq_enable();
   191	
   192		return 0;
   193	}
   194	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-17 13:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17 13:10 [jpoimboe:sframe-2.1 5/5] kernel/unwind/user.c:179:19: warning: shift count >= width of type kernel test robot

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