From: kernel test robot <lkp@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Joerg Roedel <joerg.roedel@amd.com>,
Kevin Tian <kevin.tian@intel.com>,
Vasant Hegde <vasant.hegde@amd.com>
Subject: include/linux/bitops.h:273:19: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000)
Date: Thu, 14 May 2026 10:48:45 +0800 [thread overview]
Message-ID: <202605141052.09y2OBtB-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e1914add2799225a87502051415fc5c32aeb02ae
commit: 879ced2bab1ba95e98fac56c9503791183bc7cbb iommupt: Add the AMD IOMMU v1 page table format
date: 6 months ago
config: um-randconfig-r134-20260514 (https://download.01.org/0day-ci/archive/20260514/202605141052.09y2OBtB-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605141052.09y2OBtB-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
| Fixes: 879ced2bab1b ("iommupt: Add the AMD IOMMU v1 page table format")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605141052.09y2OBtB-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/iommu/generic_pt/fmt/iommu_amdv1.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:273:19: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000)
include/linux/bitops.h:278:16: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000)
vim +273 include/linux/bitops.h
c320592f3f2a1e Wolfram Sang 2025-01-07 261
952043ac12a117 Steven Whitehouse 2009-04-23 262 /**
952043ac12a117 Steven Whitehouse 2009-04-23 263 * __ffs64 - find first set bit in a 64 bit word
952043ac12a117 Steven Whitehouse 2009-04-23 264 * @word: The 64 bit word
952043ac12a117 Steven Whitehouse 2009-04-23 265 *
4945cca232ce8b Geert Uytterhoeven 2021-02-25 266 * On 64 bit arches this is a synonym for __ffs
952043ac12a117 Steven Whitehouse 2009-04-23 267 * The result is not defined if no bits are set, so check that @word
952043ac12a117 Steven Whitehouse 2009-04-23 268 * is non-zero before calling this.
952043ac12a117 Steven Whitehouse 2009-04-23 269 */
6606c8c7e81886 Kees Cook 2025-08-04 270 static inline __attribute_const__ unsigned int __ffs64(u64 word)
952043ac12a117 Steven Whitehouse 2009-04-23 271 {
952043ac12a117 Steven Whitehouse 2009-04-23 272 #if BITS_PER_LONG == 32
952043ac12a117 Steven Whitehouse 2009-04-23 @273 if (((u32)word) == 0UL)
952043ac12a117 Steven Whitehouse 2009-04-23 274 return __ffs((u32)(word >> 32)) + 32;
952043ac12a117 Steven Whitehouse 2009-04-23 275 #elif BITS_PER_LONG != 64
952043ac12a117 Steven Whitehouse 2009-04-23 276 #error BITS_PER_LONG not 32 or 64
952043ac12a117 Steven Whitehouse 2009-04-23 277 #endif
952043ac12a117 Steven Whitehouse 2009-04-23 278 return __ffs((unsigned long)word);
952043ac12a117 Steven Whitehouse 2009-04-23 279 }
952043ac12a117 Steven Whitehouse 2009-04-23 280
:::::: The code at line 273 was first introduced by commit
:::::: 952043ac12a117d8e94bddd9088338d7ad20ca7d bitops: Add __ffs64 bitop
:::::: TO: Steven Whitehouse <swhiteho@redhat.com>
:::::: CC: Steven Whitehouse <swhiteho@redhat.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-05-14 2:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 2:48 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-10 15:19 include/linux/bitops.h:273:19: sparse: sparse: cast truncates bits from constant value (ffffffffff000 becomes fffff000) kernel test robot
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=202605141052.09y2OBtB-lkp@intel.com \
--to=lkp@intel.com \
--cc=jgg@nvidia.com \
--cc=joerg.roedel@amd.com \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=vasant.hegde@amd.com \
/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.