drivers: infiniband: save return value of pci_find_capability() in u8
Subsystems (2)
PATCH 1/1 drivers: infiniband: save return value of pci_find_capability() in u8
Callers of pci_find_capability should save the return value in u8. change type of variables from int to u8 to match the specification.
Signed-off-by Puranjay Mohan <[email protected]>
--- drivers/infiniband/hw/mthca/mthca_reset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mthca/mthca_reset.c +2 -2
@@ -45,9 +45,9 @@ int mthca_reset(struct mthca_dev *mdev)u32 *hca_header =NULL ;u32 *bridge_header =NULL ;struct pci_dev *bridge =NULL ; -int bridge_pcix_cap =0 ; +u8 bridge_pcix_cap =0 ;int hca_pcie_cap =0 ; -int hca_pcix_cap =0 ; +u8 hca_pcix_cap =0 ;u16 devctl;u16 linkctl;
Signature · 1 line
2.27.0
Quoted 13 lines · Puranjay Mohan
Callers of
pci_find_capabilityshould save the return value in u8. change type of variables from int to u8 to match the specification.Signed-off-by Puranjay Mohan <[email protected]>--- drivers/infiniband/hw/mthca/mthca_reset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/infiniband/hw/mthca/mthca_reset.c +0
-0
drivers/infiniband/hw/mthca/mthca_reset.c int mthca_reset(struct mthca_dev *mdev) · line 50
Quoted 8 lines
drivers/infiniband/hw/mthca/mthca_reset.c +2
-2@@ -45,9 +45,9 @@ int mthca_reset(struct mthca_dev *mdev)u32 *hca_header =NULL ;u32 *bridge_header =NULL ;struct pci_dev *bridge =NULL ; -int bridge_pcix_cap =0 ; +u8 bridge_pcix_cap =0 ;int hca_pcie_cap =0 ; -int hca_pcix_cap =0 ; +u8 hca_pcix_cap =0 ;
I don't think this is really worth changing. That mthca_reset() path is such a mess that this is the least of the worries there. This patch shouldn't have any risk, but I wouldn't want my fingerprints on that function in case somebody else looks at it later ;-)
Quoted 5 lines
drivers/infiniband/hw/mthca/mthca_reset.c +0
-0u16 devctl;u16 linkctl;Signature · 1 line
2.27.0