Skip to content

Commit ac93cfa

Browse files
rleonkawasaki
authored andcommitted
PCI/P2PDMA: Remove redundant bus_offset from map state
Remove the bus_off field from pci_p2pdma_map_state since it duplicates information already available in the pgmap structure. The bus_offset is only used in one location (pci_p2pdma_bus_addr_map) and is always identical to pgmap->bus_offset. Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 28b3384 commit ac93cfa

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/pci/p2pdma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,6 @@ void __pci_p2pdma_update_state(struct pci_p2pdma_map_state *state,
10091009
{
10101010
state->pgmap = page_pgmap(page);
10111011
state->map = pci_p2pdma_map_type(state->pgmap, dev);
1012-
state->bus_off = to_p2p_pgmap(state->pgmap)->bus_offset;
10131012
}
10141013

10151014
/**

include/linux/pci-p2pdma.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ enum pci_p2pdma_map_type {
146146
struct pci_p2pdma_map_state {
147147
struct dev_pagemap *pgmap;
148148
enum pci_p2pdma_map_type map;
149-
u64 bus_off;
150149
};
151150

152151
/* helper for pci_p2pdma_state(), do not use directly */
@@ -186,7 +185,7 @@ static inline dma_addr_t
186185
pci_p2pdma_bus_addr_map(struct pci_p2pdma_map_state *state, phys_addr_t paddr)
187186
{
188187
WARN_ON_ONCE(state->map != PCI_P2PDMA_MAP_BUS_ADDR);
189-
return paddr + state->bus_off;
188+
return paddr + to_p2p_pgmap(state->pgmap)->bus_offsetf;
190189
}
191190

192191
#endif /* _LINUX_PCI_P2P_H */

0 commit comments

Comments
 (0)