[PATCH 05/14] mm/early_ioremap: Add prototype for early_memremap_pgprot_adjust

From
Mel Gorman <hidden>
Date
2021-05-20 08:49:22
Also in
lkml
Reply to
Mel Gorman, 2021-05-20
make W=1 generates the following warning for mm/early_ioremap.c

mm/early_ioremap.c:34:24: warning: no previous prototype for ‘early_memremap_pgprot_adjust’ [-Wmissing-prototypes]
 pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The weak functions that can be overridden by architectures are
declared in include/asm-generic/early_ioremap.h so add the prototype
there. The asm/fixmap.h header is need for pgprot_t.

Signed-off-by: Mel Gorman <redacted>
---
 include/asm-generic/early_ioremap.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/include/asm-generic/early_ioremap.h b/include/asm-generic/early_ioremap.h
index 9def22e6e2b3..022f8f908b42 100644
--- a/include/asm-generic/early_ioremap.h
+++ b/include/asm-generic/early_ioremap.h
@@ -3,6 +3,7 @@
 #define _ASM_EARLY_IOREMAP_H_
 
 #include <linux/types.h>
+#include <asm/fixmap.h>
 
 /*
  * early_ioremap() and early_iounmap() are for temporary early boot-time
@@ -19,6 +20,14 @@ extern void *early_memremap_prot(resource_size_t phys_addr,
 extern void early_iounmap(void __iomem *addr, unsigned long size);
 extern void early_memunmap(void *addr, unsigned long size);
 
+/*
+ * Weak function called by early_memremap and early_memremap_ro. It does
+ * nothing, but architectures may provide their own version to handle
+ * memory encryption.
+ */
+extern pgprot_t early_memremap_pgprot_adjust(resource_size_t phys_addr,
+					    unsigned long size, pgprot_t prot);
+
 /*
  * Weak function called by early_ioremap_reset(). It does nothing, but
  * architectures may provide their own version to do any needed cleanups.
-- 
2.26.2

Thread (23 messages) 23 messages, 6 authors, last reply 2021-07-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help