Skip to contentSkip to conversation

mm: Remove duplicate definitions of MADV_FREE

PATCH In review Guenter Roeck 2 participants 2 messages Jan 18, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: Remove duplicate definitions of MADV_FREE

Commits 21f55b018ba5 ("arch/*/include/uapi/asm/mman.h: : let MADV_FREE have same value for all architectures") and ef58978f1eaa ("mm: define MADV_FREE for some arches") both defined MADV_FREE, but did not use the same values. This results in build errors such as

./arch/alpha/include/uapi/asm/mman.h:53:0: error: "MADV_FREE" redefined ./arch/alpha/include/uapi/asm/mman.h:50:0: note:
this is the location of the previous definition

for the affected architectures.

Fixes 21f55b018ba5 ("arch/*/include/uapi/asm/mman.h: : let MADV_FREE have same value for all architectures")
Fixes ef58978f1eaa ("mm: define MADV_FREE for some arches")
Cc Chen Gang <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Andrew Morton <[email protected]>
---
 arch/alpha/include/uapi/asm/mman.h  | 1 -
 arch/mips/include/uapi/asm/mman.h   | 1 -
 arch/parisc/include/uapi/asm/mman.h | 1 -
 arch/xtensa/include/uapi/asm/mman.h | 1 -
 4 files changed, 4 deletions(-)
arch/alpha/include/uapi/asm/mman.h +0 -1
index ab336c06153e..fec1947b8dbc 100644
@@ -47,7 +47,6 @@
 #define MADV_WILLNEED	3		/* will need these pages */
 #define	MADV_SPACEAVAIL	5		/* ensure resources are available */
 #define MADV_DONTNEED	6		/* don't need these pages */
-#define MADV_FREE	7		/* free pages only if memory pressure */
 
 /* common/generic parameters */
 #define MADV_FREE	8		/* free pages only if memory pressure */
arch/mips/include/uapi/asm/mman.h +0 -1
index b0ebe59f73fd..ccdcfcbb24aa 100644
@@ -73,7 +73,6 @@
 #define MADV_SEQUENTIAL 2		/* expect sequential page references */
 #define MADV_WILLNEED	3		/* will need these pages */
 #define MADV_DONTNEED	4		/* don't need these pages */
-#define MADV_FREE	5		/* free pages only if memory pressure */
 
 /* common parameters: try to keep these consistent across architectures */
 #define MADV_FREE	8		/* free pages only if memory pressure */
arch/parisc/include/uapi/asm/mman.h +0 -1
index cf830d465f75..f3db7d8eb0c2 100644
@@ -43,7 +43,6 @@
 #define MADV_SPACEAVAIL 5               /* insure that resources are reserved */
 #define MADV_VPS_PURGE  6               /* Purge pages from VM page cache */
 #define MADV_VPS_INHERIT 7              /* Inherit parents page size */
-#define MADV_FREE	8		/* free pages only if memory pressure */
 
 /* common/generic parameters */
 #define MADV_FREE	8		/* free pages only if memory pressure */
arch/xtensa/include/uapi/asm/mman.h +0 -1
index d030594ed22b..9e079d49e7f2 100644
@@ -86,7 +86,6 @@
 #define MADV_SEQUENTIAL	2		/* expect sequential page references */
 #define MADV_WILLNEED	3		/* will need these pages */
 #define MADV_DONTNEED	4		/* don't need these pages */
-#define MADV_FREE	5		/* free pages only if memory pressure */
 
 /* common parameters: try to keep these consistent across architectures */
 #define MADV_FREE	8		/* free pages only if memory pressure */
Signature · 1 line
2.1.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Guenter Roeck

Commits 21f55b018ba5 ("arch/*/include/uapi/asm/mman.h: : let MADV_FREE have same value for all architectures") and ef58978f1eaa ("mm: define MADV_FREE for some arches") both defined MADV_FREE, but did not use the same values. This results in build errors such as

./arch/alpha/include/uapi/asm/mman.h:53:0: error: "MADV_FREE" redefined ./arch/alpha/include/uapi/asm/mman.h:50:0: note:
this is the location of the previous definition

Quoted 8 lines

for the affected architectures.

Fixes 21f55b018ba5 ("arch/*/include/uapi/asm/mman.h: : let MADV_FREE have same value for all architectures")
Fixes ef58978f1eaa ("mm: define MADV_FREE for some arches")
Cc Chen Gang <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Andrew Morton <[email protected]>

On parisc both definitions of MADV_FREE are 8, so I do not face the compiler error. Nevertheless it should be cleaned up.

Thanks!
Helge

Quoted 19 lines
---
 arch/alpha/include/uapi/asm/mman.h  | 1 -
 arch/mips/include/uapi/asm/mman.h   | 1 -
 arch/parisc/include/uapi/asm/mman.h | 1 -
 arch/xtensa/include/uapi/asm/mman.h | 1 -
 4 files changed, 4 deletions(-)
arch/parisc/include/uapi/asm/mman.h +0 -1
index cf830d465f75..f3db7d8eb0c2 100644
@@ -43,7 +43,6 @@
 #define MADV_SPACEAVAIL 5               /* insure that resources are reserved */
 #define MADV_VPS_PURGE  6               /* Purge pages from VM page cache */
 #define MADV_VPS_INHERIT 7              /* Inherit parents page size */
-#define MADV_FREE	8		/* free pages only if memory pressure */
 
 /* common/generic parameters */
 #define MADV_FREE	8		/* free pages only if memory pressure */