[jirislaby:vt_pointers 11/12] drivers/video/fbdev/vga16fb.c:1324:29: sparse: sparse: incorrect type in assignment (different address spaces)

From: kernel test robot
Date: Tue Aug 03 2021 - 08:55:30 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git vt_pointers
head: 70b570206f002ac37185cf1e9d7739983ee6464e
commit: f2ab8e81f30418861dff07f36ab1fcfbc50aebb0 [11/12] make VGA_MAP_MEM return pointer
config: powerpc64-randconfig-s032-20210803 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?id=f2ab8e81f30418861dff07f36ab1fcfbc50aebb0
git remote add jirislaby https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git
git fetch --no-tags jirislaby vt_pointers
git checkout f2ab8e81f30418861dff07f36ab1fcfbc50aebb0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> drivers/video/fbdev/vga16fb.c:1324:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char *screen_buffer @@ got void [noderef] __iomem * @@
drivers/video/fbdev/vga16fb.c:1324:29: sparse: expected char *screen_buffer
drivers/video/fbdev/vga16fb.c:1324:29: sparse: got void [noderef] __iomem *

vim +1324 drivers/video/fbdev/vga16fb.c

1302
1303 static int vga16fb_probe(struct platform_device *dev)
1304 {
1305 struct fb_info *info;
1306 struct vga16fb_par *par;
1307 int i;
1308 int ret = 0;
1309
1310 printk(KERN_DEBUG "vga16fb: initializing\n");
1311 info = framebuffer_alloc(sizeof(struct vga16fb_par), &dev->dev);
1312
1313 if (!info) {
1314 ret = -ENOMEM;
1315 goto err_fb_alloc;
1316 }
1317 info->apertures = alloc_apertures(1);
1318 if (!info->apertures) {
1319 ret = -ENOMEM;
1320 goto err_ioremap;
1321 }
1322
1323 /* XXX share VGA_FB_PHYS and I/O region with vgacon and others */
> 1324 info->screen_buffer = VGA_MAP_MEM(VGA_FB_PHYS, 0);
1325
1326 if (!info->screen_base) {
1327 printk(KERN_ERR "vga16fb: unable to map device\n");
1328 ret = -ENOMEM;
1329 goto err_ioremap;
1330 }
1331
1332 printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base);
1333 par = info->par;
1334
1335 par->isVGA = screen_info.orig_video_isVGA;
1336 par->palette_blanked = 0;
1337 par->vesa_blanked = 0;
1338
1339 i = par->isVGA? 6 : 2;
1340
1341 vga16fb_defined.red.length = i;
1342 vga16fb_defined.green.length = i;
1343 vga16fb_defined.blue.length = i;
1344
1345 /* name should not depend on EGA/VGA */
1346 info->fbops = &vga16fb_ops;
1347 info->var = vga16fb_defined;
1348 info->fix = vga16fb_fix;
1349 /* supports rectangles with widths of multiples of 8 */
1350 info->pixmap.blit_x = 1 << 7 | 1 << 15 | 1 << 23 | 1 << 31;
1351 info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE |
1352 FBINFO_HWACCEL_YPAN;
1353
1354 i = (info->var.bits_per_pixel == 8) ? 256 : 16;
1355 ret = fb_alloc_cmap(&info->cmap, i, 0);
1356 if (ret) {
1357 printk(KERN_ERR "vga16fb: unable to allocate colormap\n");
1358 ret = -ENOMEM;
1359 goto err_alloc_cmap;
1360 }
1361
1362 if (vga16fb_check_var(&info->var, info)) {
1363 printk(KERN_ERR "vga16fb: unable to validate variable\n");
1364 ret = -EINVAL;
1365 goto err_check_var;
1366 }
1367
1368 vga16fb_update_fix(info);
1369
1370 info->apertures->ranges[0].base = VGA_FB_PHYS;
1371 info->apertures->ranges[0].size = VGA_FB_PHYS_LEN;
1372
1373 if (register_framebuffer(info) < 0) {
1374 printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
1375 ret = -EINVAL;
1376 goto err_check_var;
1377 }
1378
1379 fb_info(info, "%s frame buffer device\n", info->fix.id);
1380 platform_set_drvdata(dev, info);
1381
1382 return 0;
1383
1384 err_check_var:
1385 fb_dealloc_cmap(&info->cmap);
1386 err_alloc_cmap:
1387 iounmap(info->screen_base);
1388 err_ioremap:
1389 framebuffer_release(info);
1390 err_fb_alloc:
1391 return ret;
1392 }
1393

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip