Subject: [arm:cex7 88/106] drivers/ata/ahci_qoriq.c:217:17: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kbuild test robot <[email-masked]>
Date: Fri, 29 May 2020 13:25:03 +0800

tree:   git://git.armlinux.org.uk/~rmk/linux-arm.git cex7
head:   96bd73e4644e76befe9ab998e070a679ae08388c
commit: 04d1ec3ed831580aadbdac12b36b6158ad80dad4 [88/106] ahci: qoriq: workaround for errata A-379364 on lx2160a
config: openrisc-randconfig-s032-20200528 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-243-gc100a7ab-dirty
        git checkout 04d1ec3ed831580aadbdac12b36b6158ad80dad4
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=openrisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <[email-masked]>

sparse warnings: (new ones prefixed by >>)

>> drivers/ata/ahci_qoriq.c:217:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> *[assigned] rcw_base @@
>> drivers/ata/ahci_qoriq.c:217:17: sparse:     expected void *addr
>> drivers/ata/ahci_qoriq.c:217:17: sparse:     got void [noderef] <asn:2> *[assigned] rcw_base
>> drivers/ata/ahci_qoriq.c:219:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> *[assigned] serdes_base @@
   drivers/ata/ahci_qoriq.c:219:17: sparse:     expected void *addr
>> drivers/ata/ahci_qoriq.c:219:17: sparse:     got void [noderef] <asn:2> *[assigned] serdes_base
>> drivers/ata/ahci_qoriq.c:221:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> *[assigned] dev_con_base @@
   drivers/ata/ahci_qoriq.c:221:17: sparse:     expected void *addr
>> drivers/ata/ahci_qoriq.c:221:17: sparse:     got void [noderef] <asn:2> *[assigned] dev_con_base
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@

vim +217 drivers/ata/ahci_qoriq.c

   103	
   104	static void fsl_sata_errata_379364(bool select)
   105	{
   106		int val = 0;
   107		void __iomem *rcw_base = NULL;
   108		void __iomem *serdes_base = NULL;
   109		void __iomem *dev_con_base = NULL;
   110	
   111		if (select) {
   112			dev_con_base = ioremap(DEVICE_CONFIG_REG_BASE, PAGE_SIZE);
   113			if (!dev_con_base)
   114				return;
   115	
   116			val = (readl(dev_con_base + SYS_VER_REG) & GENMASK(7, 4)) >> 4;
   117			if (val != LX2160A_VER1)
   118				goto dev_unmap;
   119	
   120			/*
   121			 * Add few msec delay.
   122			 * Check for corresponding serdes lane RST_DONE .
   123			 * apply lane reset.
   124			 */
   125	
   126			serdes_base = ioremap(SERDES2_BASE, PAGE_SIZE);
   127			if (!serdes_base)
   128				goto dev_unmap;
   129	
   130			rcw_base = ioremap(RCWSR29_BASE, PAGE_SIZE);
   131			if (!rcw_base)
   132				goto serdes_unmap;
   133	
   134			msleep(20);
   135	
   136			val = (readl(rcw_base) & GENMASK(25, 21)) >> 21;
   137	
   138			switch (val) {
   139			case 1:
   140				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAC)) &
   141					LN_RX_MASK) != LN_RX_RST_DONE)
   142					writel(LN_RX_RST, serdes_base +
   143						SERDES2_LNAX_RX_CR(SERDES2_LNAC));
   144				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAD)) &
   145					LN_RX_MASK) != LN_RX_RST_DONE)
   146					writel(LN_RX_RST, serdes_base +
   147						SERDES2_LNAX_RX_CR(SERDES2_LNAD));
   148				break;
   149	
   150			case 4:
   151				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAG)) &
   152					LN_RX_MASK) != LN_RX_RST_DONE)
   153					writel(LN_RX_RST, serdes_base +
   154						SERDES2_LNAX_RX_CR(SERDES2_LNAG));
   155				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAH)) &
   156					LN_RX_MASK) != LN_RX_RST_DONE)
   157					writel(LN_RX_RST, serdes_base +
   158						SERDES2_LNAX_RX_CR(SERDES2_LNAH));
   159				break;
   160	
   161			case 5:
   162				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAE)) &
   163					LN_RX_MASK) != LN_RX_RST_DONE)
   164					writel(LN_RX_RST, serdes_base +
   165						SERDES2_LNAX_RX_CR(SERDES2_LNAE));
   166				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAF)) &
   167					LN_RX_MASK) != LN_RX_RST_DONE)
   168					writel(LN_RX_RST, serdes_base +
   169						SERDES2_LNAX_RX_CR(SERDES2_LNAF));
   170				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAG)) &
   171					LN_RX_MASK) != LN_RX_RST_DONE)
   172					writel(LN_RX_RST, serdes_base +
   173						SERDES2_LNAX_RX_CR(SERDES2_LNAG));
   174				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAH)) &
   175					LN_RX_MASK) != LN_RX_RST_DONE)
   176					writel(LN_RX_RST, serdes_base +
   177						SERDES2_LNAX_RX_CR(SERDES2_LNAH));
   178				break;
   179	
   180			case 8:
   181				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAC)) &
   182					LN_RX_MASK) != LN_RX_RST_DONE)
   183					writel(LN_RX_RST, serdes_base +
   184						SERDES2_LNAX_RX_CR(SERDES2_LNAC));
   185				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAD)) &
   186					LN_RX_MASK) != LN_RX_RST_DONE)
   187					writel(LN_RX_RST, serdes_base +
   188						SERDES2_LNAX_RX_CR(SERDES2_LNAD));
   189				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAE)) &
   190					LN_RX_MASK) != LN_RX_RST_DONE)
   191					writel(LN_RX_RST, serdes_base +
   192						SERDES2_LNAX_RX_CR(SERDES2_LNAE));
   193				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAF)) &
   194					LN_RX_MASK) != LN_RX_RST_DONE)
   195					writel(LN_RX_RST, serdes_base +
   196						SERDES2_LNAX_RX_CR(SERDES2_LNAF));
   197				break;
   198	
   199			case 12:
   200				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAG)) &
   201					LN_RX_MASK) != LN_RX_RST_DONE)
   202					writel(LN_RX_RST, serdes_base +
   203						SERDES2_LNAX_RX_CR(SERDES2_LNAG));
   204				if ((readl(serdes_base + SERDES2_LNAX_RX_CBR(SERDES2_LNAH)) &
   205					LN_RX_MASK) != LN_RX_RST_DONE)
   206					writel(LN_RX_RST, serdes_base +
   207						SERDES2_LNAX_RX_CR(SERDES2_LNAH));
   208				break;
   209	
   210			default:
   211				break;
   212			}
   213		} else {
   214			return;
   215		}
   216	
 > 217		iounmap(rcw_base);
   218	serdes_unmap:
 > 219		iounmap(serdes_base);
   220	dev_unmap:
 > 221		iounmap(dev_con_base);
   222	}
   223	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email-masked]
_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel