[jgunthorpe:iommu_pt_arm64 19/37] include/linux/bitops.h:279:19: sparse: sparse: cast truncates bits from constant value (fffffffffffe0 becomes ffffffe0)

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://github.com/jgunthorpe/linux iommu_pt_arm64
head:   ec570e1cdbc0f03b5f4f9940802c7579d913e1ce
commit: c5d3121e6ad2a22ea8059b1ef203c86fd1649625 [19/37] iommupt/armv8: Implement the iommu specific components
config: um-randconfig-r134-20260820 (https://download.01.org/0day-ci/archive/20260820/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260820/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
   drivers/iommu/generic_pt/fmt/iommu_armv8.c: note: in included file (through drivers/iommu/generic_pt/fmt/../pt_log2.h, drivers/iommu/generic_pt/fmt/../pt_defs.h, drivers/iommu/generic_pt/fmt/iommu_template.h):
>> include/linux/bitops.h:279:19: sparse: sparse: cast truncates bits from constant value (fffffffffffe0 becomes ffffffe0)
   include/linux/bitops.h:284:16: sparse: sparse: cast truncates bits from constant value (fffffffffffe0 becomes ffffffe0)
>> include/linux/bitops.h:279:19: sparse: sparse: cast truncates bits from constant value (fffffffffffe0 becomes ffffffe0)
   include/linux/bitops.h:284:16: sparse: sparse: cast truncates bits from constant value (fffffffffffe0 becomes ffffffe0)

vim +279 include/linux/bitops.h

c320592f3f2a1e6 Wolfram Sang       2025-01-07  267  
952043ac12a117d Steven Whitehouse  2009-04-23  268  /**
952043ac12a117d Steven Whitehouse  2009-04-23  269   * __ffs64 - find first set bit in a 64 bit word
952043ac12a117d Steven Whitehouse  2009-04-23  270   * @word: The 64 bit word
952043ac12a117d Steven Whitehouse  2009-04-23  271   *
4945cca232ce8bc Geert Uytterhoeven 2021-02-25  272   * On 64 bit arches this is a synonym for __ffs
952043ac12a117d Steven Whitehouse  2009-04-23  273   * The result is not defined if no bits are set, so check that @word
952043ac12a117d Steven Whitehouse  2009-04-23  274   * is non-zero before calling this.
952043ac12a117d Steven Whitehouse  2009-04-23  275   */
6606c8c7e818865 Kees Cook          2025-08-04  276  static inline __attribute_const__ unsigned int __ffs64(u64 word)
952043ac12a117d Steven Whitehouse  2009-04-23  277  {
952043ac12a117d Steven Whitehouse  2009-04-23  278  #if BITS_PER_LONG == 32
952043ac12a117d Steven Whitehouse  2009-04-23 @279  	if (((u32)word) == 0UL)
952043ac12a117d Steven Whitehouse  2009-04-23  280  		return __ffs((u32)(word >> 32)) + 32;
952043ac12a117d Steven Whitehouse  2009-04-23  281  #elif BITS_PER_LONG != 64
952043ac12a117d Steven Whitehouse  2009-04-23  282  #error BITS_PER_LONG not 32 or 64
952043ac12a117d Steven Whitehouse  2009-04-23  283  #endif
952043ac12a117d Steven Whitehouse  2009-04-23  284  	return __ffs((unsigned long)word);
952043ac12a117d Steven Whitehouse  2009-04-23  285  }
952043ac12a117d Steven Whitehouse  2009-04-23  286  

:::::: The code at line 279 was first introduced by commit
:::::: 952043ac12a117d8e94bddd9088338d7ad20ca7d bitops: Add __ffs64 bitop

:::::: TO: Steven Whitehouse <[email protected]>
:::::: CC: Steven Whitehouse <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.