linux
Function do_sect_fault defined but not used if ARM_LPAE is enabled
Apparently, at some point do_page_fault replaced do_sect_fault in ARM_LPAE configurations, but do_page_fault remained defined. Thus, if ARM_LPAE is enabled, do_page_fault is defined but never used.
Bug fixed by commit 809e660f438
| Type | DeadCode |
| Config | "ARM_LPAE" (1st degree) |
| Fix-in | mapping |
| Location | arch/arm/ |
static int do_page_fault()
{
return 0;
}
static int do_sect_fault() // ERROR: dead code
{
return 0;
}
int main()
{
#ifdef CONFIG_ARM_LPAE
do_page_fault();
#else
do_page_fault();
do_sect_fault();
#endif
return 0;
}
diff --git a/simple/809e660.c b/simple/809e660.c
--- a/simple/809e660.c
+++ b/simple/809e660.c
@@ -4,10 +4,12 @@
return 0;
}
+#ifndef CONFIG_ARM_LPAE
static int do_sect_fault() // ERROR: dead code
{
return 0;
}
+#endif
int main()
{
. ERROR arch/arm/mm/fault.c:494:do_sect_fault()