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: Thu, 14 May 2026 06:01:49 +0800 [thread overview]
Message-ID: <202605140524.y3KmLKef-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: e1914add2799225a87502051415fc5c32aeb02ae
commit: ae332ec0009d762982540635411caefeafa92a5b thermal/drivers/rockchip: Support reading trim values from OTP
date: 10 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 10 months ago
config: sparc-randconfig-r134-20260513 (https://download.01.org/0day-ci/archive/20260514/202605140524.y3KmLKef-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140524.y3KmLKef-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
| Fixes: ae332ec0009d ("thermal/drivers/rockchip: Support reading trim values from OTP")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202605140524.y3KmLKef-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> 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
cbac8f639437732 Caesar Wang 2014-11-24 1472
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1473 /**
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1474 * rockchip_get_efuse_value - read an OTP cell from a device node
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1475 * @np: pointer to the device node with the nvmem-cells property
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1476 * @cell_name: name of cell that should be read
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1477 * @value: pointer to where the read value will be placed
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1478 *
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1479 * Return: Negative errno on failure, during which *value will not be touched,
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1480 * or 0 on success.
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1481 */
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1482 static int rockchip_get_efuse_value(struct device_node *np, const char *cell_name,
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1483 int *value)
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1484 {
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1485 struct nvmem_cell *cell;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1486 int ret = 0;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1487 size_t len;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1488 u8 *buf;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1489 int i;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1490
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1491 cell = of_nvmem_cell_get(np, cell_name);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1492 if (IS_ERR(cell))
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1493 return PTR_ERR(cell);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1494
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1495 buf = nvmem_cell_read(cell, &len);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1496
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1497 nvmem_cell_put(cell);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1498
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1499 if (IS_ERR(buf))
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1500 return PTR_ERR(buf);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1501
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1502 if (len > sizeof(*value)) {
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1503 ret = -ERANGE;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1504 goto exit;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1505 }
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1506
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1507 /* Copy with implicit endian conversion */
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1508 *value = 0;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 @1509 for (i = 0; i < len; i++)
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1510 *value |= (int) buf[i] << (8 * i);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1511
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1512 exit:
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1513 kfree(buf);
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1514 return ret;
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1515 }
ae332ec0009d762 Nicolas Frattaroli 2025-06-10 1516
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-05-13 22:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 22:01 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-21 0:10 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=202605140524.y3KmLKef-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.