]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
PCI: rockchip-ep: Use a macro to define EP controller .align feature
authorDamien Le Moal <dlemoal@kernel.org>
Thu, 17 Oct 2024 01:58:37 +0000 (10:58 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 25 Nov 2024 19:18:35 +0000 (13:18 -0600)
Introduce the macro ROCKCHIP_PCIE_AT_SIZE_ALIGN to initialize the .align
field of the controller epc_features structure to 256. This is defined
as a shift using the macro ROCKCHIP_PCIE_AT_MIN_NUM_BITS (to avoid
using the "magic" value 8 directly).

Link: https://lore.kernel.org/r/20241017015849.190271-3-dlemoal@kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/pcie-rockchip-ep.c
drivers/pci/controller/pcie-rockchip.h

index a6805b005798c35c6733f1c556f2c1ac634f0251..65014681d8592814c746a8b5aa9e95a74b6ade04 100644 (file)
@@ -449,7 +449,7 @@ static const struct pci_epc_features rockchip_pcie_epc_features = {
        .linkup_notifier = false,
        .msi_capable = true,
        .msix_capable = false,
-       .align = 256,
+       .align = ROCKCHIP_PCIE_AT_SIZE_ALIGN,
 };
 
 static const struct pci_epc_features*
index 15ee949f2485e34e8752b85e3432dbef5548203c..02368ce9bd5484a53dd607f370a18e7df1de5d9f 100644 (file)
 
 #define ROCKCHIP_PCIE_AT_MIN_NUM_BITS  8
 #define ROCKCHIP_PCIE_AT_MAX_NUM_BITS  20
+#define ROCKCHIP_PCIE_AT_SIZE_ALIGN    (1UL << ROCKCHIP_PCIE_AT_MIN_NUM_BITS)
 
 #define ROCKCHIP_PCIE_AT_IB_EP_FUNC_BAR_ADDR0(fn, bar) \
        (PCIE_CORE_AXI_CONF_BASE + 0x0828 + (fn) * 0x0040 + (bar) * 0x0008)