Skip to contentSkip to conversation

PCI: xgene: Use PCI_VENDOR_ID_AMCC macro

PATCH Applied Pali Rohár 3 participants 3 messages Sep 27, 2021 – Sep 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: xgene: Use PCI_VENDOR_ID_AMCC macro

Header file linux/pci_ids.h defines AMCC vendor id (0x10e8) macro named PCI_VENDOR_ID_AMCC. So use this macro instead of driver custom macro.

---
 drivers/pci/controller/pci-xgene.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pci-xgene.c +1 -2
index e64536047b65..56d0d50338c8 100644
@@ -48,7 +48,6 @@
 #define EN_COHERENCY			0xF0000000
 #define EN_REG				0x00000001
 #define OB_LO_IO			0x00000002
-#define XGENE_PCIE_VENDORID		0x10E8
 #define XGENE_PCIE_DEVICEID		0xE004
 #define SZ_1T				(SZ_1G*1024ULL)
 #define PIPE_PHY_RATE_RD(src)		((0xc000 & (u32)(src)) >> 0xe)
@@ -560,7 +559,7 @@ static int xgene_pcie_setup(struct xgene_pcie_port *port)
 	xgene_pcie_clear_config(port);
 
 	/* setup the vendor and device IDs correctly */
-	val = (XGENE_PCIE_DEVICEID << 16) | XGENE_PCIE_VENDORID;
+	val = (XGENE_PCIE_DEVICEID << 16) | PCI_VENDOR_ID_AMCC;
 	xgene_pcie_writel(port, BRIDGE_CFG_0, val);
 
 	ret = xgene_pcie_map_ranges(port);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Pali,

Quoted 2 lines

Header file linux/pci_ids.h defines AMCC vendor id (0x10e8) macro named PCI_VENDOR_ID_AMCC. So use this macro instead of driver custom macro.

[...]

Quoted 1 line

-#define XGENE_PCIE_VENDORID 0x10E8

Another possible way of doing this might have been to alias the macro:

	#define XGENE_PCIE_VENDORID		PCI_VENDOR_ID_AMCC

Not sure if this would be more or less confusing - I certainly had to go and look up what "AMCC" was. Only to found out they got sold few years ago, and such...

Nothing to change here, though.

drivers/pci/controller/pci-xgene.c static int xgene_pcie_setup(struct xgene_pcie_port *port) · line 563

Quoted 10 lines

#define XGENE_PCIE_DEVICEID 0xE004
#define SZ_1T (SZ_1G*1024ULL)
#define PIPE_PHY_RATE_RD(src) ((0xc000 & (u32)(src)) >> 0xe)

drivers/pci/controller/pci-xgene.c +1 -1
@@ -560,7 +559,7 @@ static int xgene_pcie_setup(struct xgene_pcie_port *port)
 	xgene_pcie_clear_config(port);
 
 	/* setup the vendor and device IDs correctly */
-	val = (XGENE_PCIE_DEVICEID << 16) | XGENE_PCIE_VENDORID;
+	val = (XGENE_PCIE_DEVICEID << 16) | PCI_VENDOR_ID_AMCC;
 	xgene_pcie_writel(port, BRIDGE_CFG_0, val);

Thank you!

Krzysztof