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
Subject: drivers/thermal/rockchip_thermal.c:1509:25: sparse: sparse: unsigned value that used to be signed checked against zero?
Date: Tue, 21 Oct 2025 08:10:49 +0800	[thread overview]
Message-ID: <202510210808.FqJMUhmR-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "low confidence static check warning: drivers/thermal/rockchip_thermal.c:1509:25: sparse: sparse: unsigned value that used to be signed checked against zero?"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
CC: Daniel Lezcano <daniel.lezcano@linaro.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6548d364a3e850326831799d7e3ea2d7bb97ba08
commit: ae332ec0009d762982540635411caefeafa92a5b thermal/drivers/rockchip: Support reading trim values from OTP
date:   3 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 3 months ago
config: riscv-randconfig-r122-20251021 (https://download.01.org/0day-ci/archive/20251021/202510210808.FqJMUhmR-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 754ebc6ebb9fb9fbee7aef33478c74ea74949853)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251021/202510210808.FqJMUhmR-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/r/202510210808.FqJMUhmR-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> drivers/thermal/rockchip_thermal.c:1509:25: sparse: sparse: unsigned value that used to be signed checked against zero?
>> drivers/thermal/rockchip_thermal.c:1514:16: sparse: signed value source

vim +1509 drivers/thermal/rockchip_thermal.c

cbac8f63943773 Caesar Wang        2014-11-24  1472  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1473  /**
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1474   * rockchip_get_efuse_value - read an OTP cell from a device node
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1475   * @np: pointer to the device node with the nvmem-cells property
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1476   * @cell_name: name of cell that should be read
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1477   * @value: pointer to where the read value will be placed
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1478   *
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1479   * Return: Negative errno on failure, during which *value will not be touched,
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1480   * or 0 on success.
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1481   */
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1482  static int rockchip_get_efuse_value(struct device_node *np, const char *cell_name,
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1483  				    int *value)
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1484  {
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1485  	struct nvmem_cell *cell;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1486  	int ret = 0;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1487  	size_t len;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1488  	u8 *buf;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1489  	int i;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1490  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1491  	cell = of_nvmem_cell_get(np, cell_name);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1492  	if (IS_ERR(cell))
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1493  		return PTR_ERR(cell);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1494  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1495  	buf = nvmem_cell_read(cell, &len);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1496  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1497  	nvmem_cell_put(cell);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1498  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1499  	if (IS_ERR(buf))
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1500  		return PTR_ERR(buf);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1501  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1502  	if (len > sizeof(*value)) {
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1503  		ret = -ERANGE;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1504  		goto exit;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1505  	}
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1506  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1507  	/* Copy with implicit endian conversion */
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1508  	*value = 0;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10 @1509  	for (i = 0; i < len; i++)
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1510  		*value |= (int) buf[i] << (8 * i);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1511  
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1512  exit:
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1513  	kfree(buf);
ae332ec0009d76 Nicolas Frattaroli 2025-06-10 @1514  	return ret;
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1515  }
ae332ec0009d76 Nicolas Frattaroli 2025-06-10  1516  

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

             reply	other threads:[~2025-10-21  0:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21  0:10 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-05-13 22:01 drivers/thermal/rockchip_thermal.c:1509:25: sparse: sparse: unsigned value that used to be signed checked against zero? 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=202510210808.FqJMUhmR-lkp@intel.com \
    --to=lkp@intel.com \
    --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.