From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: drivers/nvmem/m24lr.c:343:24: sparse: warning: cast to restricted __le16
Date: Wed, 02 Dec 2026 12:36:20 +0100 [thread overview]
Message-ID: <20261202123040.QucVF99z-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/nvmem/m24lr.c:343:24: sparse: warning: cast to restricted __le16"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
CC: Wolfram Sang <wsa-dev@sang-engineering.com>
CC: Srinivas Kandagatla <srini@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 693c2e04e3f1d4c59af236e1211b7b8cb165a790
commit: cf09b7a05618bea99468b67fe80202efba1b48ad eeprom: move nvmem EEPROM drivers to drivers/nvmem/
date: 4 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 4 months ago
config: x86_64-randconfig-2300-20261130 (https://download.01.org/0day-ci/archive/20261202/20261202123040.QucVF99z-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
sparse: v0.6.5-rc1-94-g0d159c10
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261202/20261202123040.QucVF99z-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: cf09b7a05618 ("eeprom: move nvmem EEPROM drivers to drivers/nvmem/")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261202123040.QucVF99z-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/nvmem/m24lr.c:343:24: sparse: warning: cast to restricted __le16
>> drivers/nvmem/m24lr.c:343:24: sparse: warning: cast from restricted __le64
>> drivers/nvmem/m24lr.c:346:24: sparse: warning: cast to restricted __le32
drivers/nvmem/m24lr.c:346:24: sparse: warning: cast from restricted __le64
>> drivers/nvmem/m24lr.c:117:9: sparse: warning: Initializer entry defined twice
drivers/nvmem/m24lr.c:118:9: sparse: also defined here
vim +343 drivers/nvmem/m24lr.c
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 323
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 324 static ssize_t m24lr_read_reg_le(struct m24lr *m24lr, u64 *val,
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 325 unsigned int reg_addr,
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 326 unsigned int reg_size)
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 327 {
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 328 ssize_t ret;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 329 __le64 input = 0;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 330
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 331 ret = m24lr_read(m24lr, (u8 *)&input, reg_size, reg_addr, false);
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 332 if (IS_ERR_VALUE(ret))
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 333 return ret;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 334
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 335 if (ret != reg_size)
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 336 return -EINVAL;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 337
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 338 switch (reg_size) {
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 339 case 1:
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 340 *val = *(u8 *)&input;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 341 break;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 342 case 2:
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 @343 *val = le16_to_cpu((__le16)input);
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 344 break;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 345 case 4:
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 @346 *val = le32_to_cpu((__le32)input);
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 347 break;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 348 case 8:
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 349 *val = le64_to_cpu((__le64)input);
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 350 break;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 351 default:
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 352 return -EINVAL;
b009c1dbfc9854 drivers/misc/eeprom/m24lr.c Chen Ni 2025-08-21 353 }
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 354
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 355 return 0;
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 356 }
cd5c5e0231c538 drivers/misc/eeprom/m24lr.c Abd-Alrhman Masalkhi 2025-07-17 357
:::::: The code at line 343 was first introduced by commit
:::::: cd5c5e0231c538a5d2d4a73f3b3ffc77ff08449c eeprom: add driver for ST M24LR series RFID/NFC EEPROM chips
:::::: TO: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-12-02 11:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 11:36 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-12-03 2:32 drivers/nvmem/m24lr.c:343:24: sparse: warning: cast to restricted __le16 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=20261202123040.QucVF99z-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.