Re: [PATCH] drivers: infiniband: save return value of pci_find_capability() in u8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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
> 



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux