[PATCH] asm-generic: Fix build when __set_fixmap is absent

From: Mark Rutland
Date: Tue Feb 09 2016 - 09:27:36 EST


Commit ac4c0ac73485 ("asm-generic: make __set_fixmap_offset a static
inline") relied on the architecture code to define a __set_fixmap
function, even if unused. This broke the build for architectures which
do not implement __set_fixmap:

../include/asm-generic/fixmap.h:Infunction'__set_fixmap_offset':
../include/asm-generic/fixmap.h:77:2:error:implicitdeclarationof
function'__set_fixmap'[-Werror=implicit-function-declaration]

As we only require the prototype to be present, add this to
asm-generic/fixmap.h, preventing build failures on these architectures.

Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
Reported-by: Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx>
Suggested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
Cc: Jeremy Linton <jeremy.linton@xxxxxxx>
Cc: Laura Abbott <labbott@xxxxxxxxxxxxxxxxx>
---
include/asm-generic/fixmap.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h
index f9c27b6..e5255ff 100644
--- a/include/asm-generic/fixmap.h
+++ b/include/asm-generic/fixmap.h
@@ -69,6 +69,8 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
__set_fixmap(idx, 0, FIXMAP_PAGE_CLEAR)
#endif

+void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot);
+
/* Return a pointer with offset calculated */
static inline unsigned long __set_fixmap_offset(enum fixed_addresses idx,
phys_addr_t phys,
--
1.9.1