Skip to content

Commit 01dcec6

Browse files
nxpfrankliLorenzo Pieralisi
authored andcommitted
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/[email protected] Signed-off-by: Frank Li <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent 2b35c88 commit 01dcec6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/pci/endpoint/functions/pci-epf-vntb.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ struct epf_ntb {
136136

137137
struct epf_ntb_ctrl *reg;
138138

139-
void __iomem *epf_db;
139+
u32 *epf_db;
140140

141141
phys_addr_t vpci_mw_phy[MAX_MW];
142142
void __iomem *vpci_mw_addr[MAX_MW];
@@ -257,12 +257,10 @@ static void epf_ntb_cmd_handler(struct work_struct *work)
257257
ntb = container_of(work, struct epf_ntb, cmd_handler.work);
258258

259259
for (i = 1; i < ntb->db_count; i++) {
260-
if (readl(ntb->epf_db + i * sizeof(u32))) {
261-
if (readl(ntb->epf_db + i * sizeof(u32)))
262-
ntb->db |= 1 << (i - 1);
263-
260+
if (ntb->epf_db[i]) {
261+
ntb->db |= 1 << (i - 1);
264262
ntb_db_event(&ntb->ntb, i);
265-
writel(0, ntb->epf_db + i * sizeof(u32));
263+
ntb->epf_db[i] = 0;
266264
}
267265
}
268266

0 commit comments

Comments
 (0)