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

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

 



On 12/6/20 11:45, 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.

I did not understand this, pci_find_capability() does not return u8. 

what is it that we are achieving by changing the variable type ?

This patch will probably also generate type mismatch warning with

certain static analyzers.

> Signed-off-by: Puranjay Mohan <puranjay12@xxxxxxxxx>
> ---
>  drivers/block/mtip32xx/mtip32xx.c | 2 +-
>  drivers/block/skd_main.c          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
> index 153e2cdecb4d..da57d37c6d20 100644
> --- a/drivers/block/mtip32xx/mtip32xx.c
> +++ b/drivers/block/mtip32xx/mtip32xx.c
> @@ -3936,7 +3936,7 @@ static DEFINE_HANDLER(7);
>  
>  static void mtip_disable_link_opts(struct driver_data *dd, struct pci_dev *pdev)
>  {
> -	int pos;
> +	u8 pos;
>  	unsigned short pcie_dev_ctrl;
>  
>  	pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
> diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
> index a962b4551bed..16d59569129b 100644
> --- a/drivers/block/skd_main.c
> +++ b/drivers/block/skd_main.c
> @@ -3136,7 +3136,7 @@ MODULE_DEVICE_TABLE(pci, skd_pci_tbl);
>  
>  static char *skd_pci_info(struct skd_device *skdev, char *str)
>  {
> -	int pcie_reg;
> +	u8 pcie_reg;
>  
>  	strcpy(str, "PCIe (");
>  	pcie_reg = pci_find_capability(skdev->pdev, PCI_CAP_ID_EXP);






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux