All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [android-common:android14-kiwi-6.1 95/95] drivers/base/cacheinfo.c:259:5-11: WARNING: Unsigned expression compared with zero: leaves > 0
Date: Mon, 26 Jan 2026 08:53:35 +0800	[thread overview]
Message-ID: <202601260810.WCHpkdOG-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-01-26  0:54 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=202601260810.WCHpkdOG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@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 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.