summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorFrank Li <frank.li@nxp.com>2022-11-02 10:10:13 -0400
committerLorenzo Pieralisi <lpieralisi@kernel.org>2022-11-23 18:08:57 +0100
commit01dcec6d57ce62d535b2016fc4a617627fff506d (patch)
tree16d294f9ad93d01a8866b690cce9b7fe1c3e73f3 /drivers/pci
parent2b35c886556a24f1531edf38a4dab53bbbea4db4 (diff)
downloadlinux-01dcec6d57ce62d535b2016fc4a617627fff506d.tar.bz2
PCI: endpoint: pci-epf-vntb: Fix sparse build warning for epf_db
Use epf_db[i] dereference instead of readl() because epf_db is in memory allocated by dma_alloc_coherent(), not I/O. Remove useless/duplicated readl() in the process. Link: https://lore.kernel.org/r/20221102141014.1025893-7-Frank.Li@nxp.com Signed-off-by: Frank Li <frank.li@nxp.com> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/endpoint/functions/pci-epf-vntb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
index 54616281da9e..f896846ed970 100644
--- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
@@ -136,7 +136,7 @@ struct epf_ntb {
struct epf_ntb_ctrl *reg;
- void __iomem *epf_db;
+ u32 *epf_db;
phys_addr_t vpci_mw_phy[MAX_MW];
void __iomem *vpci_mw_addr[MAX_MW];
@@ -257,12 +257,10 @@ static void epf_ntb_cmd_handler(struct work_struct *work)
ntb = container_of(work, struct epf_ntb, cmd_handler.work);
for (i = 1; i < ntb->db_count; i++) {
- if (readl(ntb->epf_db + i * sizeof(u32))) {
- if (readl(ntb->epf_db + i * sizeof(u32)))
- ntb->db |= 1 << (i - 1);
-
+ if (ntb->epf_db[i]) {
+ ntb->db |= 1 << (i - 1);
ntb_db_event(&ntb->ntb, i);
- writel(0, ntb->epf_db + i * sizeof(u32));
+ ntb->epf_db[i] = 0;
}
}