drivers/mfd/ls2k-bmc-core.c:108:14: sparse: sparse: incorrect type in assignment (different address spaces)

From: kernel test robot

Date: Mon Mar 02 2026 - 04:55:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 11439c4635edd669ae435eec308f4ab8a0804808
commit: 0d64f6d1ffe96f59145481f7413344b1fa3ad1ce mfd: ls2kbmc: Introduce Loongson-2K BMC core driver
date: 5 months ago
config: loongarch-randconfig-r112-20260302 (https://download.01.org/0day-ci/archive/20260302/202603021730.Yy3QXYTw-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 15.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260302/202603021730.Yy3QXYTw-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
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603021730.Yy3QXYTw-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/mfd/ls2k-bmc-core.c:108:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char *mode @@ got void [noderef] __iomem * @@
drivers/mfd/ls2k-bmc-core.c:108:14: sparse: expected char *mode
drivers/mfd/ls2k-bmc-core.c:108:14: sparse: got void [noderef] __iomem *

vim +108 drivers/mfd/ls2k-bmc-core.c

97
98 /*
99 * Currently the Loongson-2K BMC hardware does not have an I2C interface to adapt to the
100 * resolution. We set the resolution by presetting "video=1280x1024-16@2M" to the BMC memory.
101 */
102 static int ls2k_bmc_parse_mode(struct pci_dev *pdev, struct simplefb_platform_data *pd)
103 {
104 char *mode;
105 int depth, ret;
106
107 /* The last 16M of PCI BAR0 is used to store the resolution string. */
> 108 mode = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0) + SZ_16M, SZ_16M);
109 if (!mode)
110 return -ENOMEM;
111
112 /* The resolution field starts with the flag "video=". */
113 if (!strncmp(mode, "video=", 6))
114 mode = mode + 6;
115
116 ret = kstrtoint(strsep(&mode, "x"), 10, &pd->width);
117 if (ret)
118 return ret;
119
120 ret = kstrtoint(strsep(&mode, "-"), 10, &pd->height);
121 if (ret)
122 return ret;
123
124 ret = kstrtoint(strsep(&mode, "@"), 10, &depth);
125 if (ret)
126 return ret;
127
128 pd->stride = pd->width * depth / 8;
129 pd->format = depth == 32 ? "a8r8g8b8" : "r5g6b5";
130
131 return 0;
132 }
133

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