diff mbox series

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

Message ID 20201206195120.18413-1-puranjay12@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Bjorn Helgaas
Headers show
Series drivers: infiniband: save return value of pci_find_capability() in u8 | expand

Commit Message

Puranjay Mohan Dec. 6, 2020, 7:51 p.m. UTC
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 <puranjay12@gmail.com>
---
 drivers/infiniband/hw/mthca/mthca_reset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bjorn Helgaas Dec. 7, 2020, 11:19 p.m. UTC | #1
On Mon, Dec 07, 2020 at 01:21:20AM +0530, Puranjay Mohan wrote:
> 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 <puranjay12@gmail.com>
> ---
>  drivers/infiniband/hw/mthca/mthca_reset.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c
> index 2a6979e4ae1c..1b6ec870bd47 100644
> --- a/drivers/infiniband/hw/mthca/mthca_reset.c
> +++ b/drivers/infiniband/hw/mthca/mthca_reset.c
> @@ -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 ;-)

>  	u16 devctl;
>  	u16 linkctl;
> -- 
> 2.27.0
>
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c
index 2a6979e4ae1c..1b6ec870bd47 100644
--- a/drivers/infiniband/hw/mthca/mthca_reset.c
+++ b/drivers/infiniband/hw/mthca/mthca_reset.c
@@ -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;