[PATCH] hexagon: Fix build error caused by include file order

From: Guenter Roeck
Date: Sat Jun 17 2017 - 11:15:57 EST


hexagon builds fail with the following error message.
In file included from ./include/linux/memcontrol.h:30:0,
from ./include/linux/swap.h:8,
from ./arch/hexagon/include/asm/pgtable.h:27,
from ./include/linux/mm.h:70,
from arch/hexagon/kernel/asm-offsets.c:28:
./include/linux/vmstat.h: In function '__inc_zone_page_state':
./include/linux/vmstat.h:294:2: error:
implicit declaration of function 'page_zone'

Drop unnecessary includes from header files and add missing
includes to source files to fix the problem.

Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Fixes: fb6646f52c45 ("mm: memcontrol: per-lruvec stats infrastructure")
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
arch/hexagon/include/asm/pgtable.h | 1 -
arch/hexagon/kernel/asm-offsets.c | 1 -
arch/hexagon/mm/vm_tlb.c | 1 +
3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/hexagon/include/asm/pgtable.h b/arch/hexagon/include/asm/pgtable.h
index 24a9177fb897..aef02f7ca8aa 100644
--- a/arch/hexagon/include/asm/pgtable.h
+++ b/arch/hexagon/include/asm/pgtable.h
@@ -24,7 +24,6 @@
/*
* Page table definitions for Qualcomm Hexagon processor.
*/
-#include <linux/swap.h>
#include <asm/page.h>
#define __ARCH_USE_5LEVEL_HACK
#include <asm-generic/pgtable-nopmd.h>
diff --git a/arch/hexagon/kernel/asm-offsets.c b/arch/hexagon/kernel/asm-offsets.c
index 308be68d4fb3..3980c0407aa1 100644
--- a/arch/hexagon/kernel/asm-offsets.c
+++ b/arch/hexagon/kernel/asm-offsets.c
@@ -25,7 +25,6 @@
#include <linux/compat.h>
#include <linux/types.h>
#include <linux/sched.h>
-#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/kbuild.h>
#include <asm/ptrace.h>
diff --git a/arch/hexagon/mm/vm_tlb.c b/arch/hexagon/mm/vm_tlb.c
index 9647d00cb761..b474065533ce 100644
--- a/arch/hexagon/mm/vm_tlb.c
+++ b/arch/hexagon/mm/vm_tlb.c
@@ -24,6 +24,7 @@
* be instantiated for it, differently from a native build.
*/
#include <linux/mm.h>
+#include <linux/sched.h>
#include <asm/page.h>
#include <asm/hexagon_vm.h>

--
2.7.4