History

[PATCH] Fix mempolicy.h build error

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.

Ralf Baechle committed 20 years ago

Commit 45b35a51 parent fd0a0ac1 file · +1 −0Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/linux/mempolicy.h+1−0
@@ -36,6 +36,7 @@ · 35 unmodified lines
36#include <linux/nodemask.h>36#include <linux/nodemask.h>
37 37
38struct vm_area_struct;38struct vm_area_struct;
39struct mm_struct;
39 40
40#ifdef CONFIG_NUMA41#ifdef CONFIG_NUMA
41 42

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t