drivers/mmc/host/mxcmmc.c:545:24: sparse: sparse: incorrect type in assignment (different base types)
From: kernel test robot
Date: Mon Jun 01 2026 - 10:33:02 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e43ffb69e0438cddd72aaa30898b4dc446f664f8
commit: 7cd8db0fb0b2bf309163d56fec585c0f9e0964d1 mmc: add COMPILE_TEST to multiple drivers
date: 9 months ago
config: m68k-randconfig-r111-20260601 (https://download.01.org/0day-ci/archive/20260601/202606012253.GJ9WoBvW-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 11.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260601/202606012253.GJ9WoBvW-lkp@xxxxxxxxx/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: 7cd8db0fb0b2 ("mmc: add COMPILE_TEST to multiple drivers")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606012253.GJ9WoBvW-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> drivers/mmc/host/mxcmmc.c:545:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __le32 [usertype] @@
drivers/mmc/host/mxcmmc.c:545:24: sparse: expected unsigned int [usertype]
drivers/mmc/host/mxcmmc.c:545:24: sparse: got restricted __le32 [usertype]
drivers/mmc/host/mxcmmc.c:557:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tmp @@ got restricted __le32 [usertype] @@
drivers/mmc/host/mxcmmc.c:557:21: sparse: expected unsigned int [usertype] tmp
drivers/mmc/host/mxcmmc.c:557:21: sparse: got restricted __le32 [usertype]
drivers/mmc/host/mxcmmc.c:572:37: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __le32 [usertype] @@
drivers/mmc/host/mxcmmc.c:572:37: sparse: expected unsigned int [usertype] val
drivers/mmc/host/mxcmmc.c:572:37: sparse: got restricted __le32 [usertype]
drivers/mmc/host/mxcmmc.c:585:37: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __le32 [usertype] @@
drivers/mmc/host/mxcmmc.c:585:37: sparse: expected unsigned int [usertype] val
drivers/mmc/host/mxcmmc.c:585:37: sparse: got restricted __le32 [usertype]
vim +545 drivers/mmc/host/mxcmmc.c
d96be879ff4697 Sascha Hauer 2009-01-06 535
12658af54f2ed1 Linus Walleij 2024-01-27 536 static int mxcmci_pull(struct mxcmci_host *host, u32 *buf, int bytes)
d96be879ff4697 Sascha Hauer 2009-01-06 537 {
d96be879ff4697 Sascha Hauer 2009-01-06 538 unsigned int stat;
d96be879ff4697 Sascha Hauer 2009-01-06 539
d96be879ff4697 Sascha Hauer 2009-01-06 540 while (bytes > 3) {
d96be879ff4697 Sascha Hauer 2009-01-06 541 stat = mxcmci_poll_status(host,
d96be879ff4697 Sascha Hauer 2009-01-06 542 STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE);
d96be879ff4697 Sascha Hauer 2009-01-06 543 if (stat)
d96be879ff4697 Sascha Hauer 2009-01-06 544 return stat;
c7ceab02543f8a Anatolij Gustschin 2013-04-08 @545 *buf++ = cpu_to_le32(mxcmci_readl(host, MMC_REG_BUFFER_ACCESS));
d96be879ff4697 Sascha Hauer 2009-01-06 546 bytes -= 4;
d96be879ff4697 Sascha Hauer 2009-01-06 547 }
d96be879ff4697 Sascha Hauer 2009-01-06 548
d96be879ff4697 Sascha Hauer 2009-01-06 549 if (bytes) {
d96be879ff4697 Sascha Hauer 2009-01-06 550 u8 *b = (u8 *)buf;
d96be879ff4697 Sascha Hauer 2009-01-06 551 u32 tmp;
d96be879ff4697 Sascha Hauer 2009-01-06 552
d96be879ff4697 Sascha Hauer 2009-01-06 553 stat = mxcmci_poll_status(host,
d96be879ff4697 Sascha Hauer 2009-01-06 554 STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE);
d96be879ff4697 Sascha Hauer 2009-01-06 555 if (stat)
d96be879ff4697 Sascha Hauer 2009-01-06 556 return stat;
c7ceab02543f8a Anatolij Gustschin 2013-04-08 557 tmp = cpu_to_le32(mxcmci_readl(host, MMC_REG_BUFFER_ACCESS));
d96be879ff4697 Sascha Hauer 2009-01-06 558 memcpy(b, &tmp, bytes);
d96be879ff4697 Sascha Hauer 2009-01-06 559 }
d96be879ff4697 Sascha Hauer 2009-01-06 560
d96be879ff4697 Sascha Hauer 2009-01-06 561 return 0;
d96be879ff4697 Sascha Hauer 2009-01-06 562 }
d96be879ff4697 Sascha Hauer 2009-01-06 563
:::::: The code at line 545 was first introduced by commit
:::::: c7ceab02543f8a03b4df3d4465b089c8117a5e09 mmc: mxcmmc: add mpc512x SDHC support
:::::: TO: Anatolij Gustschin <agust@xxxxxxx>
:::::: CC: Chris Ball <cjb@xxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki