linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/VPD: fix unused pci_vpd_set_size function warning
@ 2021-04-21 14:03 Arnd Bergmann
  2021-04-21 16:54 ` Krzysztof Wilczyński
  2021-04-27 10:27 ` Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-04-21 14:03 UTC (permalink / raw)
  To: Bjorn Helgaas, Krzysztof Wilczyński, Heiner Kallweit
  Cc: Arnd Bergmann, linux-pci, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The only user of this function is now in an #ifdef, causing
a warning when that symbol is not defined:

drivers/pci/vpd.c:289:13: error: 'pci_vpd_set_size' defined but not used [-Werror=unused-function]
  289 | static void pci_vpd_set_size(struct pci_dev *dev, size_t len)

Move the function into that #ifdef block.

Fixes: f349223f076e ("PCI/VPD: Remove pci_set_vpd_size()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/pci/vpd.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index 6909253bb13c..ee8c41a88548 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -286,17 +286,6 @@ static ssize_t pci_vpd_write(struct pci_dev *dev, loff_t pos, size_t count,
 	return ret ? ret : count;
 }
 
-static void pci_vpd_set_size(struct pci_dev *dev, size_t len)
-{
-	struct pci_vpd *vpd = dev->vpd;
-
-	if (!vpd || len == 0 || len > PCI_VPD_MAX_SIZE)
-		return;
-
-	vpd->valid = 1;
-	vpd->len = len;
-}
-
 static const struct pci_vpd_ops pci_vpd_ops = {
 	.read = pci_vpd_read,
 	.write = pci_vpd_write,
@@ -482,6 +471,17 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_QLOGIC, 0x2261, quirk_blacklist_vpd);
 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031,
 			      PCI_CLASS_BRIDGE_PCI, 8, quirk_blacklist_vpd);
 
+static void pci_vpd_set_size(struct pci_dev *dev, size_t len)
+{
+	struct pci_vpd *vpd = dev->vpd;
+
+	if (!vpd || len == 0 || len > PCI_VPD_MAX_SIZE)
+		return;
+
+	vpd->valid = 1;
+	vpd->len = len;
+}
+
 static void quirk_chelsio_extend_vpd(struct pci_dev *dev)
 {
 	int chip = (dev->device & 0xf000) >> 12;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI/VPD: fix unused pci_vpd_set_size function warning
  2021-04-21 14:03 [PATCH] PCI/VPD: fix unused pci_vpd_set_size function warning Arnd Bergmann
@ 2021-04-21 16:54 ` Krzysztof Wilczyński
  2021-04-27 10:27 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2021-04-21 16:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bjorn Helgaas, Heiner Kallweit, Arnd Bergmann, linux-pci, linux-kernel

Hi Arnd,

> The only user of this function is now in an #ifdef, causing
> a warning when that symbol is not defined:
> 
> drivers/pci/vpd.c:289:13: error: 'pci_vpd_set_size' defined but not used [-Werror=unused-function]
>   289 | static void pci_vpd_set_size(struct pci_dev *dev, size_t len)
> 
> Move the function into that #ifdef block.
[...]

Thank you!

Reviewed-by: Krzysztof Wilczyński <kw@linux.com>

Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI/VPD: fix unused pci_vpd_set_size function warning
  2021-04-21 14:03 [PATCH] PCI/VPD: fix unused pci_vpd_set_size function warning Arnd Bergmann
  2021-04-21 16:54 ` Krzysztof Wilczyński
@ 2021-04-27 10:27 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2021-04-27 10:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bjorn Helgaas, Krzysztof Wilczyński, Heiner Kallweit,
	Arnd Bergmann, linux-pci, Linux Kernel Mailing List

On Wed, Apr 21, 2021 at 8:56 PM Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The only user of this function is now in an #ifdef, causing
> a warning when that symbol is not defined:
>
> drivers/pci/vpd.c:289:13: error: 'pci_vpd_set_size' defined but not used [-Werror=unused-function]
>   289 | static void pci_vpd_set_size(struct pci_dev *dev, size_t len)
>
> Move the function into that #ifdef block.
>
> Fixes: f349223f076e ("PCI/VPD: Remove pci_set_vpd_size()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-27 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 14:03 [PATCH] PCI/VPD: fix unused pci_vpd_set_size function warning Arnd Bergmann
2021-04-21 16:54 ` Krzysztof Wilczyński
2021-04-27 10:27 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).