[arm:cex7 10/41] drivers/pci/controller/mobiveil/pcie-mobiveil.c:44:49: sparse: sparse: incorrect type in return expression (different address spaces)
From: kbuild test robot <hidden>
Date: 2019-10-10 00:44:28
Also in:
oe-kbuild-all
tree: git://git.armlinux.org.uk/~rmk/linux-arm.git cex7
head: 9de8c9294924dc903e79ca03162cbd208a834330
commit: 2729e9ee9e99b04171a1cddddcd3027dd350dbde [10/41] PCI: mobiveil: Refactor Mobiveil PCIe Host Bridge IP driver
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-rc1-42-g38eda53-dirty
git checkout 2729e9ee9e99b04171a1cddddcd3027dd350dbde
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <redacted>
sparse warnings: (new ones prefixed by >>)
quoted
drivers/pci/controller/mobiveil/pcie-mobiveil.c:44:49: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void * @@ got void [noderef] <asvoid * @@ drivers/pci/controller/mobiveil/pcie-mobiveil.c:44:49: sparse: expected void * drivers/pci/controller/mobiveil/pcie-mobiveil.c:44:49: sparse: got void [noderef] <asn:2> *
drivers/pci/controller/mobiveil/pcie-mobiveil.c:48:41: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void * @@ got void [noderef] <asvoid * @@ drivers/pci/controller/mobiveil/pcie-mobiveil.c:48:41: sparse: expected void * drivers/pci/controller/mobiveil/pcie-mobiveil.c:48:41: sparse: got void [noderef] <asn:2> *
quoted
drivers/pci/controller/mobiveil/pcie-mobiveil.c:106:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:2> *addr @@ got oderef] <asn:2> *addr @@ drivers/pci/controller/mobiveil/pcie-mobiveil.c:106:34: sparse: expected void [noderef] <asn:2> *addr drivers/pci/controller/mobiveil/pcie-mobiveil.c:106:34: sparse: got void *[assigned] addr
drivers/pci/controller/mobiveil/pcie-mobiveil.c:120:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:2> *addr @@ got oderef] <asn:2> *addr @@
drivers/pci/controller/mobiveil/pcie-mobiveil.c:120:35: sparse: expected void [noderef] <asn:2> *addr
drivers/pci/controller/mobiveil/pcie-mobiveil.c:120:35: sparse: got void *[assigned] addr
vim +44 drivers/pci/controller/mobiveil/pcie-mobiveil.c
38
39 static void *mobiveil_pcie_comp_addr(struct mobiveil_pcie *pcie, u32 off)
40 {
41 if (off < PAGED_ADDR_BNDRY) {
42 /* For directly accessed registers, clear the pg_sel field */
43 mobiveil_pcie_sel_page(pcie, 0);
> 44 return pcie->csr_axi_slave_base + off;
45 }
46
47 mobiveil_pcie_sel_page(pcie, OFFSET_TO_PAGE_IDX(off));
48 return pcie->csr_axi_slave_base + OFFSET_TO_PAGE_ADDR(off);
49 }
50
51 static int mobiveil_pcie_read(void __iomem *addr, int size, u32 *val)
52 {
53 if ((uintptr_t)addr & (size - 1)) {
54 *val = 0;
55 return PCIBIOS_BAD_REGISTER_NUMBER;
56 }
57
58 switch (size) {
59 case 4:
60 *val = readl(addr);
61 break;
62 case 2:
63 *val = readw(addr);
64 break;
65 case 1:
66 *val = readb(addr);
67 break;
68 default:
69 *val = 0;
70 return PCIBIOS_BAD_REGISTER_NUMBER;
71 }
72
73 return PCIBIOS_SUCCESSFUL;
74 }
75
76 static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val)
77 {
78 if ((uintptr_t)addr & (size - 1))
79 return PCIBIOS_BAD_REGISTER_NUMBER;
80
81 switch (size) {
82 case 4:
83 writel(val, addr);
84 break;
85 case 2:
86 writew(val, addr);
87 break;
88 case 1:
89 writeb(val, addr);
90 break;
91 default:
92 return PCIBIOS_BAD_REGISTER_NUMBER;
93 }
94
95 return PCIBIOS_SUCCESSFUL;
96 }
97
98 u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size)
99 {
100 void *addr;
101 u32 val;
102 int ret;
103
104 addr = mobiveil_pcie_comp_addr(pcie, off);
105
> 106 ret = mobiveil_pcie_read(addr, size, &val);
107 if (ret)
108 dev_err(&pcie->pdev->dev, "read CSR address failed\n");
109
110 return val;
111 }
112
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel