Skip to contentSkip to conversation

drivers: broadcom: save return value of pci_find_capability() in u8

PATCH In review Puranjay Mohan 2 participants 2 messages Dec 6, 2020 – Dec 7, 2020

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

PATCH 1/1 drivers: broadcom: save return value of pci_find_capability() in u8

Callers of pci_find_capability() should save the return value in u8. change the type of pcix_cap from int to u8, to match the specification.

---
 drivers/net/ethernet/broadcom/tg3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.h +1 -1
index 1000c894064f..f1781d2dce0b 100644
@@ -3268,7 +3268,7 @@ struct tg3 {
 
 	int				pci_fn;
 	int				msi_cap;
-	int				pcix_cap;
+	u8				pcix_cap;
 	int				pcie_readrq;
 
 	struct mii_bus			*mdio_bus;
Signature · 1 line
2.27.0
#1 lore raw
Quoted 13 lines · Puranjay Mohan

Callers of pci_find_capability() should save the return value in u8. change the type of pcix_cap from int to u8, to match the specification.

---
 drivers/net/ethernet/broadcom/tg3.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.h +0 -0
index 1000c894064f..f1781d2dce0b 100644

drivers/net/ethernet/broadcom/tg3.h struct tg3 { · line 3271

Quoted 5 lines
drivers/net/ethernet/broadcom/tg3.h +1 -1
@@ -3268,7 +3268,7 @@ struct tg3 {
 
 	int				pci_fn;
 	int				msi_cap;
-	int				pcix_cap;
+	u8				pcix_cap;

msi_cap is also a u8.

But I don't think it's worth changing either of these unless we take a broader look and see whether they're needed at all.

msi_cap is used to restore the MSI enable bit after a highly device-specific reset.

pcix_cap is used for some PCI-X configuration that really should be done via pcix_set_mmrbc() and possibly some sort of quirk for PCI_X_CMD_MAX_SPLIT.

But that's all pretty messy and I doubt it's worth doing it at this point, since PCI-X is pretty much ancient history.

Quoted 6 lines
drivers/net/ethernet/broadcom/tg3.h +0 -0
 	int				pcie_readrq;
 
 	struct mii_bus			*mdio_bus;
Signature · 1 line
2.27.0