llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [morse:mpam/snapshot/v6.10-rc1 65/114] drivers/platform/arm64/mpam/mpam_devices.c:318:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false
@ 2024-06-14 13:44 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-06-14 13:44 UTC (permalink / raw)
  To: James Morse; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git mpam/snapshot/v6.10-rc1
head:   d9ba67a1a8dc6551a0b3254a8f2ee9993ad17957
commit: 80bb394628b9df80413dcc6f0b9198177355c199 [65/114] arm_mpam: Add the class and component structures for ris firmware described
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240614/202406142148.278A1iXo-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 78ee473784e5ef6f0b19ce4cb111fb6e4d23c6b2)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240614/202406142148.278A1iXo-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/202406142148.278A1iXo-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/platform/arm64/mpam/mpam_devices.c:6:
   In file included from include/linux/acpi.h:39:
   In file included from include/acpi/acpi_io.h:7:
   In file included from arch/arm64/include/asm/acpi.h:14:
   In file included from include/linux/memblock.h:12:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/platform/arm64/mpam/mpam_devices.c:318: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]
     318 |                         if (cache_id == ~0UL) {
         |                             ~~~~~~~~ ^  ~~~~
   6 warnings generated.


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

   282	
   283	/*
   284	 * The cacheinfo structures are only populated when CPUs are online.
   285	 * This helper walks the device tree to include offline CPUs too.
   286	 */
   287	static int get_cpumask_from_cache_id(u32 cache_id, u32 cache_level,
   288					     cpumask_t *affinity)
   289	{
   290		int cpu, err;
   291		u32 iter_level;
   292		int iter_cache_id;
   293		struct device_node *iter;
   294	
   295		if (!acpi_disabled)
   296			return acpi_pptt_get_cpumask_from_cache_id(cache_id, affinity);
   297	
   298		for_each_possible_cpu(cpu) {
   299			iter = of_get_cpu_node(cpu, NULL);
   300			if (!iter) {
   301				pr_err("Failed to find cpu%d device node\n", cpu);
   302				return -ENOENT;
   303			}
   304	
   305			while ((iter = of_find_next_cache_node(iter))) {
   306				err = of_property_read_u32(iter, "cache-level",
   307							   &iter_level);
   308				if (err || (iter_level != cache_level)) {
   309					of_node_put(iter);
   310					continue;
   311				}
   312	
   313				/*
   314				 * get_cpu_cacheinfo_id() isn't ready until sometime
   315				 * during device_initcall(). Use cache_of_get_id().
   316				 */
   317				iter_cache_id = cache_of_get_id(iter);
 > 318				if (cache_id == ~0UL) {
   319					of_node_put(iter);
   320					continue;
   321				}
   322	
   323				if (iter_cache_id == cache_id)
   324					cpumask_set_cpu(cpu, affinity);
   325	
   326				of_node_put(iter);
   327			}
   328		}
   329	
   330		return 0;
   331	}
   332	

-- 
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-06-14 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-14 13:44 [morse:mpam/snapshot/v6.10-rc1 65/114] drivers/platform/arm64/mpam/mpam_devices.c:318:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false 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;
as well as URLs for NNTP newsgroup(s).