* [android-common:android14-kiwi-6.1 95/95] drivers/base/cacheinfo.c:259:5-11: WARNING: Unsigned expression compared with zero: leaves > 0
@ 2026-01-26 0:53 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-01-26 0:53 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: cros-kernel-buildreports@googlegroups.com
tree: https://android.googlesource.com/kernel/common android14-kiwi-6.1
head: f32d30ba0d3898356d1a193eea42a9cbdeb348ba
commit: 100309b45cc4d18815f68c97db012ab9714e25e2 [95/95] cacheinfo: Check 'cache-unified' property to count cache leaves
:::::: branch date: 16 hours ago
:::::: commit date: 7 weeks ago
config: i386-randconfig-r054-20260126 (https://download.01.org/0day-ci/archive/20260126/202601260810.WCHpkdOG-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202601260810.WCHpkdOG-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/base/cacheinfo.c:259:5-11: WARNING: Unsigned expression compared with zero: leaves > 0
vim +259 drivers/base/cacheinfo.c
100309b45cc4d1 Pierre Gondois 2025-10-21 250
100309b45cc4d1 Pierre Gondois 2025-10-21 251 int init_of_cache_level(unsigned int cpu)
100309b45cc4d1 Pierre Gondois 2025-10-21 252 {
100309b45cc4d1 Pierre Gondois 2025-10-21 253 struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
100309b45cc4d1 Pierre Gondois 2025-10-21 254 struct device_node *np = of_cpu_device_node_get(cpu);
100309b45cc4d1 Pierre Gondois 2025-10-21 255 struct device_node *prev = NULL;
100309b45cc4d1 Pierre Gondois 2025-10-21 256 unsigned int levels = 0, leaves, level;
100309b45cc4d1 Pierre Gondois 2025-10-21 257
100309b45cc4d1 Pierre Gondois 2025-10-21 258 leaves = of_count_cache_leaves(np);
a6d0510f295d99 Pierre Gondois 2025-10-21 @259 if (leaves > 0)
a6d0510f295d99 Pierre Gondois 2025-10-21 260 levels = 1;
a6d0510f295d99 Pierre Gondois 2025-10-21 261
a6d0510f295d99 Pierre Gondois 2025-10-21 262 prev = np;
a6d0510f295d99 Pierre Gondois 2025-10-21 263 while ((np = of_find_next_cache_node(np))) {
a6d0510f295d99 Pierre Gondois 2025-10-21 264 of_node_put(prev);
a6d0510f295d99 Pierre Gondois 2025-10-21 265 prev = np;
a6d0510f295d99 Pierre Gondois 2025-10-21 266 if (!of_device_is_compatible(np, "cache"))
52a43345ec152e Pierre Gondois 2025-10-21 267 goto err_out;
a6d0510f295d99 Pierre Gondois 2025-10-21 268 if (of_property_read_u32(np, "cache-level", &level))
52a43345ec152e Pierre Gondois 2025-10-21 269 goto err_out;
a6d0510f295d99 Pierre Gondois 2025-10-21 270 if (level <= levels)
52a43345ec152e Pierre Gondois 2025-10-21 271 goto err_out;
100309b45cc4d1 Pierre Gondois 2025-10-21 272
100309b45cc4d1 Pierre Gondois 2025-10-21 273 leaves += of_count_cache_leaves(np);
a6d0510f295d99 Pierre Gondois 2025-10-21 274 levels = level;
a6d0510f295d99 Pierre Gondois 2025-10-21 275 }
a6d0510f295d99 Pierre Gondois 2025-10-21 276
a6d0510f295d99 Pierre Gondois 2025-10-21 277 of_node_put(np);
a6d0510f295d99 Pierre Gondois 2025-10-21 278 this_cpu_ci->num_levels = levels;
a6d0510f295d99 Pierre Gondois 2025-10-21 279 this_cpu_ci->num_leaves = leaves;
a6d0510f295d99 Pierre Gondois 2025-10-21 280
a6d0510f295d99 Pierre Gondois 2025-10-21 281 return 0;
52a43345ec152e Pierre Gondois 2025-10-21 282
52a43345ec152e Pierre Gondois 2025-10-21 283 err_out:
52a43345ec152e Pierre Gondois 2025-10-21 284 of_node_put(np);
52a43345ec152e Pierre Gondois 2025-10-21 285 return -EINVAL;
a6d0510f295d99 Pierre Gondois 2025-10-21 286 }
a6d0510f295d99 Pierre Gondois 2025-10-21 287
:::::: The code at line 259 was first introduced by commit
:::::: a6d0510f295d99739abe16349a9c5d7a7f0ee55d cacheinfo: Use RISC-V's init_cache_level() as generic OF implementation
:::::: TO: Pierre Gondois <pierre.gondois@arm.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
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:[~2026-01-26 0:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 0:53 [android-common:android14-kiwi-6.1 95/95] drivers/base/cacheinfo.c:259:5-11: WARNING: Unsigned expression compared with zero: leaves > 0 kernel test robot
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.