]> www.infradead.org Git - linux.git/commitdiff
x86/mm: Add early_memremap_pgprot_adjust() prototype
authorArnd Bergmann <arnd@arndb.de>
Tue, 16 May 2023 19:35:47 +0000 (21:35 +0200)
committerDave Hansen <dave.hansen@linux.intel.com>
Thu, 18 May 2023 18:56:18 +0000 (11:56 -0700)
early_memremap_pgprot_adjust() is a __weak function with a local
prototype, but x86 has a custom implementation that does not
see the prototype, causing a W=1 warning:

arch/x86/mm/ioremap.c:785:17: error: no previous prototype for 'early_memremap_pgprot_adjust' [-Werror=missing-prototypes]

Move the declaration into the global linux/io.h header to avoid this.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://lore.kernel.org/all/20230516193549.544673-19-arnd%40kernel.org
include/linux/io.h
mm/internal.h

index 308f4f0cfb93284143c0b9158fc5e68da1e6b3e7..7304f2a69960a3493d7b218e43ee9a2155df78f2 100644 (file)
@@ -68,6 +68,11 @@ void *devm_memremap(struct device *dev, resource_size_t offset,
                size_t size, unsigned long flags);
 void devm_memunmap(struct device *dev, void *addr);
 
+/* architectures can override this */
+pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
+                                       unsigned long size, pgprot_t prot);
+
+
 #ifdef CONFIG_PCI
 /*
  * The PCI specifications (Rev 3.0, 3.2.5 "Transaction Ordering and
index 68410c6d97aca9d801b4fd8a8ef6b7070c2aa70d..e6029d94bdb200b10149720f9ba88595b2c7133a 100644 (file)
@@ -178,12 +178,6 @@ extern unsigned long highest_memmap_pfn;
  */
 #define MAX_RECLAIM_RETRIES 16
 
-/*
- * in mm/early_ioremap.c
- */
-pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
-                                       unsigned long size, pgprot_t prot);
-
 /*
  * in mm/vmscan.c:
  */