Skip to content

Commit 4d312ac

Browse files
arndbhansendc
authored andcommitted
x86/mm: Add early_memremap_pgprot_adjust() prototype
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
1 parent 3b939ba commit 4d312ac

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

include/linux/io.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ void *devm_memremap(struct device *dev, resource_size_t offset,
6868
size_t size, unsigned long flags);
6969
void devm_memunmap(struct device *dev, void *addr);
7070

71+
/* architectures can override this */
72+
pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
73+
unsigned long size, pgprot_t prot);
74+
75+
7176
#ifdef CONFIG_PCI
7277
/*
7378
* The PCI specifications (Rev 3.0, 3.2.5 "Transaction Ordering and

mm/internal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,6 @@ extern unsigned long highest_memmap_pfn;
178178
*/
179179
#define MAX_RECLAIM_RETRIES 16
180180

181-
/*
182-
* in mm/early_ioremap.c
183-
*/
184-
pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr,
185-
unsigned long size, pgprot_t prot);
186-
187181
/*
188182
* in mm/vmscan.c:
189183
*/

0 commit comments

Comments
 (0)