Re: [PATCH resend] PCI: Make the pci_dev_present() stub a static inline

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

 



On Fri, Dec 17, 2021 at 03:15:15PM +0100, Hans de Goede wrote:
> Change the pci_dev_present() stub which is used when CONFIG_PCI is not set
> from a #define to a static inline stub.
> 
> Thix should fix clang -Werror builds failing due to errors like this:
> 
> drivers/platform/x86/thinkpad_acpi.c:4475:35:
>  error: unused variable 'fwbug_cards_ids' [-Werror,-Wunused-const-variable]
> 
> Where fwbug_cards_ids is an array if pci_device_id-s passed to
> pci_dev_present() during a quirk check.
> 
> Fixing this in include/linux/pci.h should ensure that the same issue is
> also fixed in any other drivers hitting the same -Werror issue.
> 
> Cc: platform-driver-x86@xxxxxxxxxxxxxxx
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>

Applied to pci/enumeration for v5.17, thanks!

> ---
>  include/linux/pci.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 18a75c8e615c..7d825637d7ca 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1775,7 +1775,10 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
>  					    struct pci_dev *from)
>  { return NULL; }
>  
> -#define pci_dev_present(ids)	(0)
> +
> +static inline int pci_dev_present(const struct pci_device_id *ids)
> +{ return 0; }
> +
>  #define no_pci_devices()	(1)
>  #define pci_dev_put(dev)	do { } while (0)
>  
> -- 
> 2.33.1
> 



[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