PCI: endpoint: pci-epf-vntb: Fix the incorrect usage of __iomem attribute
Subsystems (3)
Manivannan Sadhasivam
maintainerPATCH 1/1 PCI: endpoint: pci-epf-vntb: Fix the incorrect usage of __iomem attribute
__iomem attribute is supposed to be used only with variables holding the MMIO pointer. But here, 'mw_addr' variable is just holding a 'void *' returned by pci_epf_alloc_space(). So annotating it with __iomem is clearly wrong. Hence, drop the attribute.
This also fixes the below sparse warning:
drivers/pci/endpoint/functions/pci-epf-vntb.c:524:17: warning: incorrect type in assignment (different address spaces)
drivers/pci/endpoint/functions/pci-epf-vntb.c:524:17: expected void [noderef] __iomem *mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:524:17: got void *
drivers/pci/endpoint/functions/pci-epf-vntb.c:530:21: warning: incorrect type in assignment (different address spaces)
drivers/pci/endpoint/functions/pci-epf-vntb.c:530:21: expected unsigned int [usertype] *epf_db
drivers/pci/endpoint/functions/pci-epf-vntb.c:530:21: got void [noderef] __iomem *mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:542:38: warning: incorrect type in argument 2 (different address spaces)
drivers/pci/endpoint/functions/pci-epf-vntb.c:542:38: expected void *addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:542:38: got void [noderef] __iomem *mw_addr
--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-vntb.c +1 -1
@@ -512,7 +512,7 @@ static int epf_ntb_db_bar_init(struct epf_ntb *ntb)struct device *dev = &ntb->epf->dev;int ret;struct pci_epf_bar *epf_bar; -void __iomem *mw_addr; +void *mw_addr;enum pci_barno barno;size_t size =sizeof (u32) * ntb->db_count;
Signature · 1 line
2.45.2
Quoted 17 lines · Manivannan Sadhasivam
__iomemattribute is supposed to be used only with variables holding the MMIO pointer. But here, 'mw_addr' variable is just holding a 'void *' returned bypci_epf_alloc_space(). So annotating it with__iomemis clearly wrong. Hence, drop the attribute.This also fixes the below sparse warning:
drivers/pci/endpoint/functions/pci-epf-vntb.c:524:17: warning: incorrect type in assignment (different address spaces)
drivers/pci/endpoint/functions/pci-epf-vntb.c:524:17: expected void [noderef]__iomem*mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:524:17: got void *
drivers/pci/endpoint/functions/pci-epf-vntb.c:530:21: warning: incorrect type in assignment (different address spaces)
drivers/pci/endpoint/functions/pci-epf-vntb.c:530:21: expected unsigned int [usertype]*epf_db
drivers/pci/endpoint/functions/pci-epf-vntb.c:530:21: got void [noderef]__iomem*mw_addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:542:38: warning: incorrect type in argument 2 (different address spaces)
drivers/pci/endpoint/functions/pci-epf-vntb.c:542:38: expected void *addr
drivers/pci/endpoint/functions/pci-epf-vntb.c:542:38: got void [noderef]__iomem*mw_addr
Quoted 2 lines
Fixes e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP")Signed-off-by Manivannan Sadhasivam <[email protected]>
Quoted 20 lines
--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-vntb.c +1
-2@@ -512,7 +512,7 @@ static int epf_ntb_db_bar_init(struct epf_ntb *ntb)struct device *dev = &ntb->epf->dev;int ret;struct pci_epf_bar *epf_bar; -void __iomem *mw_addr; +void *mw_addr;enum pci_barno barno;size_t size =sizeof (u32) * ntb->db_count; --2.45.2