linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Richard Henderson <richard.henderson@linaro.org>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Kuppuswamy Sathyanarayanan 
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"Ahmed S. Darwish" <darwi@linutronix.de>,
	Sami Tolvanen <samitolvanen@google.com>,
	linux-alpha@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH 04/17] pci: sysfs: move declarations to linux/pci.h
Date: Thu, 10 Aug 2023 16:19:22 +0200	[thread overview]
Message-ID: <20230810141947.1236730-5-arnd@kernel.org> (raw)
In-Reply-To: <20230810141947.1236730-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

A couple of architectures build the __weak versions of
pci_create_resource_files() and pci_remove_resource_files() but don't
have prototypes for these, which causes warnings:

drivers/pci/pci-sysfs.c:1253:12: error: no previous prototype for 'pci_create_resource_files' [-Werror=missing-prototypes]
 1253 | int __weak pci_create_resource_files(struct pci_dev *dev) { return 0; }
drivers/pci/pci-sysfs.c:1254:13: error: no previous prototype for 'pci_remove_resource_files' [-Werror=missing-prototypes]
 1254 | void __weak pci_remove_resource_files(struct pci_dev *dev) { return; }

Move the prototypes from alpha architecture into the global header to
avoid these warnings for all of them.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/alpha/include/asm/pci.h | 3 ---
 include/linux/pci.h          | 5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index 6312656279d79..6c04fcbdc8ed2 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -88,7 +88,4 @@ extern void pci_adjust_legacy_attr(struct pci_bus *bus,
 				   enum pci_mmap_state mmap_type);
 #define HAVE_PCI_LEGACY	1
 
-extern int pci_create_resource_files(struct pci_dev *dev);
-extern void pci_remove_resource_files(struct pci_dev *dev);
-
 #endif /* __ALPHA_PCI_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index eeb2e6f6130f4..198a399c4b792 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2260,6 +2260,11 @@ int pcibios_alloc_irq(struct pci_dev *dev);
 void pcibios_free_irq(struct pci_dev *dev);
 resource_size_t pcibios_default_alignment(void);
 
+#if !defined(HAVE_PCI_MMAP) && !defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)
+extern int pci_create_resource_files(struct pci_dev *dev);
+extern void pci_remove_resource_files(struct pci_dev *dev);
+#endif
+
 #if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG)
 void __init pci_mmcfg_early_init(void);
 void __init pci_mmcfg_late_init(void);
-- 
2.39.2


  reply	other threads:[~2023-08-10 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 14:19 [PATCH 00/17] -Wmissing-prototype warning fixes Arnd Bergmann
2023-08-10 14:19 ` Arnd Bergmann [this message]
2023-08-10 14:38   ` [PATCH 04/17] pci: sysfs: move declarations to linux/pci.h Bjorn Helgaas
2023-08-16 14:38 ` [PATCH 00/17] -Wmissing-prototype warning fixes Palmer Dabbelt
2023-08-25  1:12 ` (subset) " Martin K. Petersen
2023-08-25  1:30   ` Michael Schmitz
2023-08-25  7:39     ` Geert Uytterhoeven
2023-08-25 22:44       ` Michael Schmitz
2023-08-28  6:42         ` Geert Uytterhoeven
2023-08-28  8:07           ` Michael Schmitz

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=20230810141947.1236730-5-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dan.j.williams@intel.com \
    --cc=darwi@linutronix.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=ira.weiny@intel.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=richard.henderson@linaro.org \
    --cc=samitolvanen@google.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).