]> Gentwo Git Trees - linux/.git/commitdiff
PCI: endpoint: Rename 'epf_bar::aligned_size' to 'epf_bar:mem_size'
authorFrank Li <Frank.Li@nxp.com>
Wed, 15 Oct 2025 15:27:28 +0000 (11:27 -0400)
committerManivannan Sadhasivam <mani@kernel.org>
Mon, 27 Oct 2025 14:23:53 +0000 (19:53 +0530)
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
drivers/pci/endpoint/pci-epf-core.c
include/linux/pci-epf.h

index d54e18872aefc07c655c94c104a347328ff7a432..214e3f6e6d0d5a216c3469b8ff47908414cd1286 100644 (file)
@@ -236,13 +236,13 @@ void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar,
        }
 
        dev = epc->dev.parent;
-       dma_free_coherent(dev, epf_bar[bar].aligned_size, addr,
+       dma_free_coherent(dev, epf_bar[bar].mem_size, addr,
                          epf_bar[bar].phys_addr);
 
        epf_bar[bar].phys_addr = 0;
        epf_bar[bar].addr = NULL;
        epf_bar[bar].size = 0;
-       epf_bar[bar].aligned_size = 0;
+       epf_bar[bar].mem_size = 0;
        epf_bar[bar].barno = 0;
        epf_bar[bar].flags = 0;
 }
@@ -265,7 +265,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
                          enum pci_epc_interface_type type)
 {
        u64 bar_fixed_size = epc_features->bar[bar].fixed_size;
-       size_t aligned_size, align = epc_features->align;
+       size_t mem_size, align = epc_features->align;
        struct pci_epf_bar *epf_bar;
        dma_addr_t phys_addr;
        struct pci_epc *epc;
@@ -297,7 +297,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
         * it might be different if, for example, the fixed size of a BAR
         * is smaller than align.
         */
-       aligned_size = align ? ALIGN(size, align) : size;
+       mem_size = align ? ALIGN(size, align) : size;
 
        if (type == PRIMARY_INTERFACE) {
                epc = epf->epc;
@@ -308,7 +308,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
        }
 
        dev = epc->dev.parent;
-       space = dma_alloc_coherent(dev, aligned_size, &phys_addr, GFP_KERNEL);
+       space = dma_alloc_coherent(dev, mem_size, &phys_addr, GFP_KERNEL);
        if (!space) {
                dev_err(dev, "failed to allocate mem space\n");
                return NULL;
@@ -317,7 +317,7 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
        epf_bar[bar].phys_addr = phys_addr;
        epf_bar[bar].addr = space;
        epf_bar[bar].size = size;
-       epf_bar[bar].aligned_size = aligned_size;
+       epf_bar[bar].mem_size = mem_size;
        epf_bar[bar].barno = bar;
        if (upper_32_bits(size) || epc_features->bar[bar].only_64bit)
                epf_bar[bar].flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;
index 2e85504ba2baf93827224884ca19ae2bd0e6906b..4022dd080e20f2959f3a5faf4cfe054ddb5856a7 100644 (file)
@@ -115,8 +115,8 @@ struct pci_epf_driver {
  * @phys_addr: physical address that should be mapped to the BAR
  * @addr: virtual address corresponding to the @phys_addr
  * @size: the size of the address space present in BAR
- * @aligned_size: the size actually allocated to accommodate the iATU alignment
- *                requirement
+ * @mem_size: the size actually allocated to accommodate the iATU alignment
+ *            requirement
  * @barno: BAR number
  * @flags: flags that are set for the BAR
  */
@@ -124,7 +124,7 @@ struct pci_epf_bar {
        dma_addr_t      phys_addr;
        void            *addr;
        size_t          size;
-       size_t          aligned_size;
+       size_t          mem_size;
        enum pci_barno  barno;
        int             flags;
 };