drivers/video/fbdev/s3c2410fb.c:650:17: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Thu Jun 03 2021 - 23:11:50 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f88cd3fb9df228e5ce4e13ec3dbad671ddb2146e
commit: 421015713b306e47af95d4d61cdfbd96d462e4cb ARM: 9017/2: Enable KASan for ARM
date: 7 months ago
config: arm-randconfig-s031-20210604 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.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/torvalds/linux.git/commit/?id=421015713b306e47af95d4d61cdfbd96d462e4cb
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 421015713b306e47af95d4d61cdfbd96d462e4cb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=arm

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/s3c2410fb.c:643:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char [noderef] __iomem *screen_base @@ got void * @@
drivers/video/fbdev/s3c2410fb.c:643:27: sparse: expected char [noderef] __iomem *screen_base
drivers/video/fbdev/s3c2410fb.c:643:27: sparse: got void *
>> drivers/video/fbdev/s3c2410fb.c:650:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *s @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/s3c2410fb.c:650:17: sparse: expected void *s
drivers/video/fbdev/s3c2410fb.c:650:17: sparse: got char [noderef] __iomem *screen_base
drivers/video/fbdev/s3c2410fb.c:666:25: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *cpu_addr @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/s3c2410fb.c:666:25: sparse: expected void *cpu_addr
drivers/video/fbdev/s3c2410fb.c:666:25: sparse: got char [noderef] __iomem *screen_base
drivers/video/fbdev/s3c2410fb.c:666:25: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *cpu_addr @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/s3c2410fb.c:666:25: sparse: expected void *cpu_addr
drivers/video/fbdev/s3c2410fb.c:666:25: sparse: got char [noderef] __iomem *screen_base

vim +650 drivers/video/fbdev/s3c2410fb.c

20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 626
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 627 /*
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 628 * s3c2410fb_map_video_memory():
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 629 * Allocates the DRAM memory for the frame buffer. This buffer is
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 630 * remapped into a non-cached, non-buffered, memory region to
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 631 * allow palette and pixel writes to occur without flushing the
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 632 * cache. Once this area is remapped, all virtual memory
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 633 * access to the video memory should occur at the new region.
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 634 */
48c68c4f1b5424 drivers/video/s3c2410fb.c Greg Kroah-Hartman 2012-12-21 635 static int s3c2410fb_map_video_memory(struct fb_info *info)
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 636 {
110c1fa75463c4 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 637 struct s3c2410fb_info *fbi = info->par;
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 638 dma_addr_t map_dma;
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 639 unsigned map_size = PAGE_ALIGN(info->fix.smem_len);
110c1fa75463c4 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 640
38a02f560752a8 drivers/video/s3c2410fb.c Ben Dooks 2008-02-06 641 dprintk("map_video_memory(fbi=%p) map_size %u\n", fbi, map_size);
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 642
f6e45661f9be54 drivers/video/fbdev/s3c2410fb.c Luis R. Rodriguez 2016-01-22 643 info->screen_base = dma_alloc_wc(fbi->dev, map_size, &map_dma,
f6e45661f9be54 drivers/video/fbdev/s3c2410fb.c Luis R. Rodriguez 2016-01-22 644 GFP_KERNEL);
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 645
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 646 if (info->screen_base) {
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 647 /* prevent initial garbage on screen */
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 648 dprintk("map_video_memory: clear %p:%08x\n",
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 649 info->screen_base, map_size);
c0d40335353e1c drivers/video/s3c2410fb.c Ben Dooks 2008-02-06 @650 memset(info->screen_base, 0x00, map_size);
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 651
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 652 info->fix.smem_start = map_dma;
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 653
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 654 dprintk("map_video_memory: dma=%08lx cpu=%p size=%08x\n",
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 655 info->fix.smem_start, info->screen_base, map_size);
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 656 }
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 657
9fa7bc016a6886 drivers/video/s3c2410fb.c Krzysztof Helt 2007-10-16 658 return info->screen_base ? 0 : -ENOMEM;
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 659 }
20fd5767689124 drivers/video/s3c2410fb.c Arnaud Patard 2005-09-09 660

:::::: The code at line 650 was first introduced by commit
:::::: c0d40335353e1c89c9c885e5af4d0be0f1a50483 FB/S3C2410: ensure S3C2410 framebuffer clears initial memory to black

:::::: TO: Ben Dooks <ben-linux@xxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip