arch/sparc/include/asm/floppy_32.h:319:17: sparse: sparse: incorrect type in assignment (different address spaces)
From: kernel test robot
Date: Sat Jul 04 2020 - 02:35:55 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6f216714a6906d6d5d0654313d9f9a47613bb473
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 2 weeks ago
config: sparc-randconfig-s032-20200703 (attached as .config)
compiler: sparc-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-3-gfa153962-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=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> arch/sparc/include/asm/floppy_32.h:319:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sun_flpy_controller *static [toplevel] sun_fdc @@ got void [noderef] __iomem * @@
arch/sparc/include/asm/floppy_32.h:319:17: sparse: expected struct sun_flpy_controller *static [toplevel] sun_fdc
>> arch/sparc/include/asm/floppy_32.h:319:17: sparse: got void [noderef] __iomem *
vim +319 arch/sparc/include/asm/floppy_32.h
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 274
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 275 static int sun_floppy_init(void)
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 276 {
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 277 struct platform_device *op;
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 278 struct device_node *dp;
144e988dd217d8 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2012-05-12 279 struct resource r;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 280 char state[128];
144e988dd217d8 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2012-05-12 281 phandle fd_node;
144e988dd217d8 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2012-05-12 282 phandle tnode;
8d1255627d4ce9 arch/sparc/include/asm/floppy_32.h Andres Salomon 2010-10-08 283 int num_regs;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 284
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 285 use_virtual_dma = 1;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 286
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 287 /* Forget it if we aren't on a machine that could possibly
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 288 * ever have a floppy drive.
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 289 */
58fa4dcbc419c4 arch/sparc/include/asm/floppy_32.h David S. Miller 2012-05-11 290 if (sparc_cpu_model != sun4m) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 291 /* We certainly don't have a floppy controller. */
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 292 goto no_sun_fdc;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 293 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 294 /* Well, try to find one. */
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 295 tnode = prom_getchild(prom_root_node);
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 296 fd_node = prom_searchsiblings(tnode, "obio");
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 297 if (fd_node != 0) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 298 tnode = prom_getchild(fd_node);
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 299 fd_node = prom_searchsiblings(tnode, "SUNW,fdtwo");
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 300 } else {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 301 fd_node = prom_searchsiblings(tnode, "fd");
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 302 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 303 if (fd_node == 0) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 304 goto no_sun_fdc;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 305 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 306
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 307 /* The sun4m lets us know if the controller is actually usable. */
144e988dd217d8 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2012-05-12 308 if (prom_getproperty(fd_node, "status", state, sizeof(state)) != -1) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 309 if(!strcmp(state, "disabled")) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 310 goto no_sun_fdc;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 311 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 312 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 313 num_regs = prom_getproperty(fd_node, "reg", (char *) fd_regs, sizeof(fd_regs));
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 314 num_regs = (num_regs / sizeof(fd_regs[0]));
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 315 prom_apply_obio_ranges(fd_regs, num_regs);
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 316 memset(&r, 0, sizeof(r));
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 317 r.flags = fd_regs[0].which_io;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 318 r.start = fd_regs[0].phys_addr;
144e988dd217d8 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2012-05-12 @319 sun_fdc = of_ioremap(&r, 0, fd_regs[0].reg_size, "floppy");
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 320
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 321 /* Look up irq in platform_device.
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 322 * We try "SUNW,fdtwo" and "fd"
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 323 */
918f832290f01b arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2012-05-12 324 op = NULL;
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 325 for_each_node_by_name(dp, "SUNW,fdtwo") {
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 326 op = of_find_device_by_node(dp);
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 327 if (op)
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 328 break;
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 329 }
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 330 if (!op) {
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 331 for_each_node_by_name(dp, "fd") {
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 332 op = of_find_device_by_node(dp);
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 333 if (op)
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 334 break;
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 335 }
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 336 }
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 337 if (!op)
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 338 goto no_sun_fdc;
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 339
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 340 FLOPPY_IRQ = op->archdata.irqs[0];
6baa9b20a68a88 arch/sparc/include/asm/floppy_32.h Sam Ravnborg 2011-04-18 341
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 342 /* Last minute sanity check... */
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 343 if (sun_fdc->status_82072 == 0xff) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 344 sun_fdc = NULL;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 345 goto no_sun_fdc;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 346 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 347
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 348 sun_fdops.fd_inb = sun_82077_fd_inb;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 349 sun_fdops.fd_outb = sun_82077_fd_outb;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 350 fdc_status = &sun_fdc->status_82077;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 351
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 352 if (sun_fdc->dor_82077 == 0x80) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 353 sun_fdc->dor_82077 = 0x02;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 354 if (sun_fdc->dor_82077 == 0x80) {
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 355 sun_fdops.fd_inb = sun_82072_fd_inb;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 356 sun_fdops.fd_outb = sun_82072_fd_outb;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 357 fdc_status = &sun_fdc->status_82072;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 358 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 359 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 360
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 361 /* Success... */
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 362 allowed_drive_mask = 0x01;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 363 return (int) sun_fdc;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 364
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 365 no_sun_fdc:
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 366 return -1;
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 367 }
f5e706ad886b6a include/asm-sparc/floppy_32.h Sam Ravnborg 2008-07-17 368
:::::: The code at line 319 was first introduced by commit
:::::: 144e988dd217d8db1c027ef7f1b5a4061a18c874 sparc32: code cleanup in floppy glue
:::::: TO: Sam Ravnborg <sam@xxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip