Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	kernel test robot <lkp@intel.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH resend] PCI: Make the pci_dev_present() stub a static inline
Date: Fri, 17 Dec 2021 15:23:56 -0600	[thread overview]
Message-ID: <20211217212356.GA915467@bhelgaas> (raw)
In-Reply-To: <20211217141515.379586-1-hdegoede@redhat.com>

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@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

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
> 

      reply	other threads:[~2021-12-17 21:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 14:15 [PATCH resend] PCI: Make the pci_dev_present() stub a static inline Hans de Goede
2021-12-17 21:23 ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211217212356.GA915467@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox