Skip to content

Commit 4837688

Browse files
nxpfrankliMani-Sadhasivam
authored andcommitted
PCI: endpoint: Rename 'epf_bar::aligned_size' to 'epf_bar:mem_size'
Rename the member 'epf_bar::aligned_size' to 'epf_bar::mem_size' to better reflect its purpose. 'aligned_size' was misleading, as it actually represents the backing memory size allocated for the BAR rather than the aligned size. Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-1-9230298b1910@nxp.com
1 parent 25423cd commit 4837688

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/pci/endpoint/pci-epf-core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar,
236236
}
237237

238238
dev = epc->dev.parent;
239-
dma_free_coherent(dev, epf_bar[bar].aligned_size, addr,
239+
dma_free_coherent(dev, epf_bar[bar].mem_size, addr,
240240
epf_bar[bar].phys_addr);
241241

242242
epf_bar[bar].phys_addr = 0;
243243
epf_bar[bar].addr = NULL;
244244
epf_bar[bar].size = 0;
245-
epf_bar[bar].aligned_size = 0;
245+
epf_bar[bar].mem_size = 0;
246246
epf_bar[bar].barno = 0;
247247
epf_bar[bar].flags = 0;
248248
}
@@ -265,7 +265,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
265265
enum pci_epc_interface_type type)
266266
{
267267
u64 bar_fixed_size = epc_features->bar[bar].fixed_size;
268-
size_t aligned_size, align = epc_features->align;
268+
size_t mem_size, align = epc_features->align;
269269
struct pci_epf_bar *epf_bar;
270270
dma_addr_t phys_addr;
271271
struct pci_epc *epc;
@@ -297,7 +297,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
297297
* it might be different if, for example, the fixed size of a BAR
298298
* is smaller than align.
299299
*/
300-
aligned_size = align ? ALIGN(size, align) : size;
300+
mem_size = align ? ALIGN(size, align) : size;
301301

302302
if (type == PRIMARY_INTERFACE) {
303303
epc = epf->epc;
@@ -308,7 +308,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
308308
}
309309

310310
dev = epc->dev.parent;
311-
space = dma_alloc_coherent(dev, aligned_size, &phys_addr, GFP_KERNEL);
311+
space = dma_alloc_coherent(dev, mem_size, &phys_addr, GFP_KERNEL);
312312
if (!space) {
313313
dev_err(dev, "failed to allocate mem space\n");
314314
return NULL;
@@ -317,7 +317,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
317317
epf_bar[bar].phys_addr = phys_addr;
318318
epf_bar[bar].addr = space;
319319
epf_bar[bar].size = size;
320-
epf_bar[bar].aligned_size = aligned_size;
320+
epf_bar[bar].mem_size = mem_size;
321321
epf_bar[bar].barno = bar;
322322
if (upper_32_bits(size) || epc_features->bar[bar].only_64bit)
323323
epf_bar[bar].flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;

include/linux/pci-epf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ struct pci_epf_driver {
115115
* @phys_addr: physical address that should be mapped to the BAR
116116
* @addr: virtual address corresponding to the @phys_addr
117117
* @size: the size of the address space present in BAR
118-
* @aligned_size: the size actually allocated to accommodate the iATU alignment
119-
* requirement
118+
* @mem_size: the size actually allocated to accommodate the iATU alignment
119+
* requirement
120120
* @barno: BAR number
121121
* @flags: flags that are set for the BAR
122122
*/
123123
struct pci_epf_bar {
124124
dma_addr_t phys_addr;
125125
void *addr;
126126
size_t size;
127-
size_t aligned_size;
127+
size_t mem_size;
128128
enum pci_barno barno;
129129
int flags;
130130
};

0 commit comments

Comments
 (0)