Skip to content

Commit

Permalink
[PATCH] Fix mempolicy.h build error
Browse files Browse the repository at this point in the history
From: Ralf Baechle <ralf@linux-mips.org>

<linux/mempolicy.h> uses struct mm_struct and relies on a definition or
declaration somehow magically being dragged in which may result in a
build:

[...]
  CC      mm/mempolicy.o
In file included from mm/mempolicy.c:69:
include/linux/mempolicy.h:150: warning: �struct mm_struct� declared inside parameter list
include/linux/mempolicy.h:150: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/mempolicy.h:175: warning: �struct mm_struct� declared inside parameter list
mm/mempolicy.c:622: error: conflicting types for �do_migrate_pages�
include/linux/mempolicy.h:175: error: previous declaration of �do_migrate_pages� was here
mm/mempolicy.c:1661: error: conflicting types for �mpol_rebind_mm�
include/linux/mempolicy.h:150: error: previous declaration of �mpol_rebind_mm� was here
make[1]: *** [mm/mempolicy.o] Error 1
make: *** [mm] Error 2
[ralf@denk linux-ip35]$

Including <linux/sched.h> is a step into direction of include hell so
fixed by adding a forward declaration of struct mm_struct instead.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ralf Baechle authored and Linus Torvalds committed Jun 8, 2006
1 parent fd0a0ac commit 45b35a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/mempolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/nodemask.h>

struct vm_area_struct;
struct mm_struct;

#ifdef CONFIG_NUMA

Expand Down

0 comments on commit 45b35a5

Please sign in to comment.