Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: James Morse <james.morse@arm.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [morse:mpam/snapshot/v6.14-rc1 68/124] drivers/platform/arm64/mpam/mpam_devices.c:352:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false
Date: Sun, 9 Feb 2025 18:49:09 +0800	[thread overview]
Message-ID: <202502091848.Rcd80pME-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/snapshot/v6.14-rc1
head:   a185f01212c6b5421e944bef6839d6d6660e2b8b
commit: dfef24fe9ee10fc0c85f7bd6dec37e1fc003db85 [68/124] arm_mpam: Add the class and component structures for ris firmware described
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20250209/202502091848.Rcd80pME-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/20250209/202502091848.Rcd80pME-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/202502091848.Rcd80pME-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/platform/arm64/mpam/mpam_devices.c:352:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
     352 |                         if (cache_id == ~0UL) {
         |                             ~~~~~~~~ ^  ~~~~
   1 warning generated.


vim +352 drivers/platform/arm64/mpam/mpam_devices.c

   316	
   317	/*
   318	 * The cacheinfo structures are only populated when CPUs are online.
   319	 * This helper walks the device tree to include offline CPUs too.
   320	 */
   321	static int get_cpumask_from_cache_id(u32 cache_id, u32 cache_level,
   322					     cpumask_t *affinity)
   323	{
   324		int cpu, err;
   325		u32 iter_level;
   326		struct device_node *iter;
   327		unsigned long iter_cache_id;
   328	
   329		if (!acpi_disabled)
   330			return acpi_pptt_get_cpumask_from_cache_id(cache_id, affinity);
   331	
   332		for_each_possible_cpu(cpu) {
   333			iter = of_get_cpu_node(cpu, NULL);
   334			if (!iter) {
   335				pr_err("Failed to find cpu%d device node\n", cpu);
   336				return -ENOENT;
   337			}
   338	
   339			while ((iter = of_find_next_cache_node(iter))) {
   340				err = of_property_read_u32(iter, "cache-level",
   341							   &iter_level);
   342				if (err || iter_level != cache_level) {
   343					of_node_put(iter);
   344					continue;
   345				}
   346	
   347				/*
   348				 * get_cpu_cacheinfo_id() isn't ready until sometime
   349				 * during device_initcall(). Use cache_of_get_id().
   350				 */
   351				iter_cache_id = cache_of_get_id(iter);
 > 352				if (cache_id == ~0UL) {
   353					of_node_put(iter);
   354					continue;
   355				}
   356	
   357				if (iter_cache_id == cache_id)
   358					cpumask_set_cpu(cpu, affinity);
   359	
   360				of_node_put(iter);
   361			}
   362		}
   363	
   364		return 0;
   365	}
   366	

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

                 reply	other threads:[~2025-02-09 10:49 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=202502091848.Rcd80pME-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=james.morse@arm.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox