Skip to content

Commit 4b026ca

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9302/1: traps: hide unused functions on NOMMU
A couple of functions in this file are only used on MMU-enabled builds, and never even declared otherwise, causing these build warnings: arch/arm/kernel/traps.c:759:6: error: no previous prototype for '__pte_error' [-Werror=missing-prototypes] arch/arm/kernel/traps.c:764:6: error: no previous prototype for '__pmd_error' [-Werror=missing-prototypes] arch/arm/kernel/traps.c:769:6: error: no previous prototype for '__pgd_error' [-Werror=missing-prototypes] Protect these in an #ifdef to avoid the warnings and save a little bit of .text space. Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent a9f8f2b commit 4b026ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/kernel/traps.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ void __readwrite_bug(const char *fn)
756756
}
757757
EXPORT_SYMBOL(__readwrite_bug);
758758

759+
#ifdef CONFIG_MMU
759760
void __pte_error(const char *file, int line, pte_t pte)
760761
{
761762
pr_err("%s:%d: bad pte %08llx.\n", file, line, (long long)pte_val(pte));
@@ -770,6 +771,7 @@ void __pgd_error(const char *file, int line, pgd_t pgd)
770771
{
771772
pr_err("%s:%d: bad pgd %08llx.\n", file, line, (long long)pgd_val(pgd));
772773
}
774+
#endif
773775

774776
asmlinkage void __div0(void)
775777
{

0 commit comments

Comments
 (0)