PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
PATCH 1/1 PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
The TLP_REQ_ID's function is same as current PCI_DEVID() macro, replace it.
--- drivers/pci/controller/pcie-altera.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pcie-altera.c +1 -2
@@ -55,12 +55,11 @@#define TLP_READ_TAG 0x1d#define TLP_WRITE_TAG 0x10#define RP_DEVFN 0 -#define TLP_REQ_ID (bus, devfn) (((bus) << 8) | (devfn))#define TLP_CFG_DW0 (pcie, cfg) \ (((cfg) << 24) | \ TLP_PAYLOAD_SIZE)#define TLP_CFG_DW1 (pcie, tag, be) \ - (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be)) + (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))#define TLP_CFG_DW2 (bus, devfn, offset) \ (((bus) << 24) | ((devfn) << 16) | (offset))#define TLP_COMP_STATUS (s) (((s) >> 13) & 7)
Signature · 1 line
2.34.1
Quoted 4 lines · Jinjie Ruan
The TLP_REQ_ID's function is same as current
PCI_DEVID()macro, replace it.Signed-off-by Jinjie Ruan <[email protected]>
- Mani
Quoted 25 lines
--- drivers/pci/controller/pcie-altera.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/pci/controller/pcie-altera.c +1
-2@@ -55,12 +55,11 @@#define TLP_READ_TAG 0x1d#define TLP_WRITE_TAG 0x10#define RP_DEVFN 0 -#define TLP_REQ_ID (bus, devfn) (((bus) << 8) | (devfn))#define TLP_CFG_DW0 (pcie, cfg) \ (((cfg) << 24) | \ TLP_PAYLOAD_SIZE)#define TLP_CFG_DW1 (pcie, tag, be) \ - (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be)) + (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))#define TLP_CFG_DW2 (bus, devfn, offset) \ (((bus) << 24) | ((devfn) << 16) | (offset))#define TLP_COMP_STATUS (s) (((s) >> 13) & 7)Signature · 1 line
2.34.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Krzysztof Wilczyński
AppliedHello,
Quoted 2 lines
The TLP_REQ_ID's function is same as current
PCI_DEVID()macro, replace it.
Applied to controller/altera, thank you!
[1/1] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()"
https://git.kernel.org/pci/pci/c/8745aaab60a6 Krzysztof
Quoted 13 lines · Jinjie Ruan
The TLP_REQ_ID's function is same as current
PCI_DEVID()macro, replace it.Signed-off-by Jinjie Ruan <[email protected]>--- drivers/pci/controller/pcie-altera.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/pci/controller/pcie-altera.c +0
-0
drivers/pci/controller/pcie-altera.c line 62
Quoted 10 lines
drivers/pci/controller/pcie-altera.c +1
-2@@ -55,12 +55,11 @@#define TLP_READ_TAG 0x1d#define TLP_WRITE_TAG 0x10#define RP_DEVFN 0 -#define TLP_REQ_ID (bus, devfn) (((bus) << 8) | (devfn))#define TLP_CFG_DW0 (pcie, cfg) \ (((cfg) << 24) | \ TLP_PAYLOAD_SIZE)#define TLP_CFG_DW1 (pcie, tag, be) \ - (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be)) + (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
This doesn't cause a problem per se, but PCI_DEVID() is defined basically as a PCI core convenience without any particular connection to the PCIe Requester ID format, so I don't think this is an improvement.
I think it *would* be an improvement to move TLP_REQ_ID() to drivers/pci/pci.h, where other drivers could share it.
It's obvious how the Requester ID must be laid out, but I took a quick look through the PCIe spec and was surprised that I couldn't find a clear definition of it, unlike the *Completer ID*, which is specified in PCIe r6.0, sec 2.2.9.1.
Bjorn
Hello,
[...]
Quoted 7 lines
Quoted 7 lines
#define
TLP_READ_TAG0x1d
#defineTLP_WRITE_TAG0x10
#defineRP_DEVFN0drivers/pci/controller/pcie-altera.c +0
-1-#define TLP_REQ_ID (bus, devfn) (((bus) << 8) | (devfn))#define TLP_CFG_DW0 (pcie, cfg) \ (((cfg) << 24) | \ TLP_PAYLOAD_SIZE)
Quoted 8 lines
drivers/pci/controller/pcie-altera.c line 62
Quoted 3 lines
#define
TLP_CFG_DW1(pcie, tag, be)\drivers/pci/controller/pcie-altera.c +1
-1- (((TLP_REQ_ID (pcie->root_bus_nr,RP_DEVFN )) <<16 ) | (tag <<8 ) | (be)) + (((PCI_DEVID (pcie->root_bus_nr,RP_DEVFN )) <<16 ) | (tag <<8 ) | (be))This doesn't cause a problem per se, but
PCI_DEVID()is defined basically as a PCI core convenience without any particular connection to the PCIe Requester ID format, so I don't think this is an improvement.
I will drop this patch based on feedback from Bjorn.
Krzysztof