lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007240947.RyOeXTRn%lkp@intel.com>
Date:   Fri, 24 Jul 2020 09:18:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/video/fbdev/dnfb.c:159:16: sparse: sparse: cast removes
 address space '__iomem' of expression

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d15be546031cf65a0fc34879beca02fd90fe7ac7
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   5 weeks ago
config: m68k-randconfig-s032-20200723 (attached as .config)
compiler: m68k-linux-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.2-93-g4c6cbe55-dirty
        git checkout 670d0a4b10704667765f7d18f7592993d02783aa
        # 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__' ARCH=m68k 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/video/fbdev/dnfb.c:159:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/video/fbdev/dnfb.c:243:27: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected char [noderef] __iomem *screen_base @@     got unsigned char [usertype] * @@
>> drivers/video/fbdev/dnfb.c:243:27: sparse:     expected char [noderef] __iomem *screen_base
   drivers/video/fbdev/dnfb.c:243:27: sparse:     got unsigned char [usertype] *
   drivers/video/fbdev/dnfb.c:283:12: sparse: sparse: symbol 'dnfb_init' was not declared. Should it be static?
--
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got char *buf @@
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     expected void const volatile [noderef] __user *
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     got char *buf
>> drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __user *__pu_ptr @@     got char *buf @@
>> drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     expected void const [noderef] __user *__pu_ptr
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     got char *buf
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user * @@     got char const *buf @@
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     expected void const volatile [noderef] __user *
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     got char const *buf
>> drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __user *__gu_ptr @@     got char const *buf @@
>> drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     expected void const [noderef] __user *__gu_ptr
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     got char const *buf

vim +/__iomem +159 drivers/video/fbdev/dnfb.c

^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  151  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  152  	int incr, y_delta, pre_read = 0, x_end, x_word_count;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  153  	uint start_mask, end_mask, dest;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  154  	ushort *src, dummy;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  155  	short i, j;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  156  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  157  	incr = (area->dy <= area->sy) ? 1 : -1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  158  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16 @159  	src = (ushort *)(info->screen_base + area->sy * info->fix.line_length +
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  160  			(area->sx >> 4));
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  161  	dest = area->dy * (info->fix.line_length >> 1) + (area->dx >> 4);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  162  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  163  	if (incr > 0) {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  164  		y_delta = (info->fix.line_length * 8) - area->sx - area->width;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  165  		x_end = area->dx + area->width - 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  166  		x_word_count = (x_end >> 4) - (area->dx >> 4) + 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  167  		start_mask = 0xffff0000 >> (area->dx & 0xf);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  168  		end_mask = 0x7ffff >> (x_end & 0xf);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  169  		out_8(AP_CONTROL_0,
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  170  		     (((area->dx & 0xf) - (area->sx & 0xf)) % 16) | (0x4 << 5));
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  171  		if ((area->dx & 0xf) < (area->sx & 0xf))
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  172  			pre_read = 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  173  	} else {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  174  		y_delta = -((info->fix.line_length * 8) - area->sx - area->width);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  175  		x_end = area->dx - area->width + 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  176  		x_word_count = (area->dx >> 4) - (x_end >> 4) + 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  177  		start_mask = 0x7ffff >> (area->dx & 0xf);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  178  		end_mask = 0xffff0000 >> (x_end & 0xf);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  179  		out_8(AP_CONTROL_0,
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  180  		     ((-((area->sx & 0xf) - (area->dx & 0xf))) % 16) |
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  181  		     (0x4 << 5));
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  182  		if ((area->dx & 0xf) > (area->sx & 0xf))
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  183  			pre_read = 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  184  	}
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  185  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  186  	for (i = 0; i < area->height; i++) {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  187  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  188  		out_8(AP_CONTROL_3A, 0xc | (dest >> 16));
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  189  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  190  		if (pre_read) {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  191  			dummy = *src;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  192  			src += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  193  		}
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  194  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  195  		if (x_word_count) {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  196  			out_8(AP_WRITE_ENABLE, start_mask);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  197  			*src = dest;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  198  			src += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  199  			dest += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  200  			out_8(AP_WRITE_ENABLE, 0);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  201  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  202  			for (j = 1; j < (x_word_count - 1); j++) {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  203  				*src = dest;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  204  				src += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  205  				dest += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  206  			}
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  207  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  208  			out_8(AP_WRITE_ENABLE, start_mask);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  209  			*src = dest;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  210  			dest += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  211  			src += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  212  		} else {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  213  			out_8(AP_WRITE_ENABLE, start_mask | end_mask);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  214  			*src = dest;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  215  			dest += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  216  			src += incr;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  217  		}
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  218  		src += (y_delta / 16);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  219  		dest += (y_delta / 16);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  220  	}
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  221  	out_8(AP_CONTROL_0, NORMAL_MODE);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  222  }
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  223  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  224  /*
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  225   * Initialization
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  226   */
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  227  
48c68c4f1b54244 drivers/video/dnfb.c       Greg Kroah-Hartman 2012-12-21  228  static int dnfb_probe(struct platform_device *dev)
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  229  {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  230  	struct fb_info *info;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  231  	int err = 0;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  232  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  233  	info = framebuffer_alloc(0, &dev->dev);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  234  	if (!info)
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  235  		return -ENOMEM;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  236  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  237  	info->fbops = &dn_fb_ops;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  238  	info->fix = dnfb_fix;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  239  	info->var = dnfb_var;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  240  	info->var.red.length = 1;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  241  	info->var.red.offset = 0;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  242  	info->var.green = info->var.blue = info->var.red;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16 @243  	info->screen_base = (u_char *) info->fix.smem_start;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  244  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  245  	err = fb_alloc_cmap(&info->cmap, 2, 0);
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  246  	if (err < 0)
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  247  		goto release_framebuffer;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  248  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  249  	err = register_framebuffer(info);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  250  	if (err < 0) {
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  251  		fb_dealloc_cmap(&info->cmap);
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  252  		goto release_framebuffer;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  253  	}
3ae5eaec1d2d9c0 drivers/video/dnfb.c       Russell King       2005-11-09  254  	platform_set_drvdata(dev, info);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  255  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  256  	/* now we have registered we can safely setup the hardware */
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  257  	out_8(AP_CONTROL_3A, RESET_CREG);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  258  	out_be16(AP_WRITE_ENABLE, 0x0);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  259  	out_8(AP_CONTROL_0, NORMAL_MODE);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  260  	out_8(AP_CONTROL_1, (AD_BLT | DST_EQ_SRC | NORM_CREG1));
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  261  	out_8(AP_CONTROL_2, S_DATA_PLN);
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  262  	out_be16(AP_ROP_1, SWAP(0x3));
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  263  
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  264  	printk("apollo frame buffer alive and kicking !\n");
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  265  	return err;
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  266  
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  267  release_framebuffer:
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  268  	framebuffer_release(info);
6b04e9f2564a609 drivers/video/fbdev/dnfb.c Markus Elfring     2017-11-09  269  	return err;
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  270  }
^1da177e4c3f415 drivers/video/dnfb.c       Linus Torvalds     2005-04-16  271  

:::::: The code at line 159 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.org>

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

Download attachment ".config.gz" of type "application/gzip" (21908 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ