aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2015-02-11 18:26:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-11 20:06:03 -0500
commitd016bf7ece53b2b947bfd769e0842fd2feb7556b (patch)
tree2b419f2baa1f9b67f1a3f1b312d7a838bfb0bef0
parent3ae3ad4e639234a43fd3997887524d2e5345fa76 (diff)
mm: make FIRST_USER_ADDRESS unsigned long on all archs
LKP has triggered a compiler warning after my recent patch "mm: account pmd page tables to the process": mm/mmap.c: In function 'exit_mmap': >> mm/mmap.c:2857:2: warning: right shift count >= width of type [enabled by default] The code: > 2857 WARN_ON(mm_nr_pmds(mm) > 2858 round_up(FIRST_USER_ADDRESS, PUD_SIZE) >> PUD_SHIFT); In this, on tile, we have FIRST_USER_ADDRESS defined as 0. round_up() has the same type -- int. PUD_SHIFT. I think the best way to fix it is to define FIRST_USER_ADDRESS as unsigned long. On every arch for consistency. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reported-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/alpha/include/asm/pgtable.h2
-rw-r--r--arch/arc/include/asm/pgtable.h2
-rw-r--r--arch/arm/include/asm/pgtable-nommu.h2
-rw-r--r--arch/arm64/include/asm/pgtable.h2
-rw-r--r--arch/avr32/include/asm/pgtable.h2
-rw-r--r--arch/cris/include/asm/pgtable.h2
-rw-r--r--arch/frv/include/asm/pgtable.h2
-rw-r--r--arch/hexagon/include/asm/pgtable.h2
-rw-r--r--arch/ia64/include/asm/pgtable.h2
-rw-r--r--arch/m32r/include/asm/pgtable.h2
-rw-r--r--arch/m68k/include/asm/pgtable_mm.h2
-rw-r--r--arch/microblaze/include/asm/pgtable.h2
-rw-r--r--arch/mips/include/asm/pgtable-32.h2
-rw-r--r--arch/mn10300/include/asm/pgtable.h2
-rw-r--r--arch/nios2/include/asm/pgtable.h2
-rw-r--r--arch/openrisc/include/asm/pgtable.h2
-rw-r--r--arch/parisc/include/asm/pgtable.h2
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc32.h2
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h2
-rw-r--r--arch/s390/include/asm/pgtable.h2
-rw-r--r--arch/score/include/asm/pgtable.h2
-rw-r--r--arch/sh/include/asm/pgtable.h2
-rw-r--r--arch/sparc/include/asm/pgtable_32.h2
-rw-r--r--arch/sparc/include/asm/pgtable_64.h2
-rw-r--r--arch/tile/include/asm/pgtable.h2
-rw-r--r--arch/um/include/asm/pgtable-2level.h2
-rw-r--r--arch/um/include/asm/pgtable-3level.h2
-rw-r--r--arch/x86/include/asm/pgtable_types.h2
-rw-r--r--arch/xtensa/include/asm/pgtable.h2
29 files changed, 29 insertions, 29 deletions
diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
index fce22cf88ee9..a9a119592372 100644
--- a/arch/alpha/include/asm/pgtable.h
+++ b/arch/alpha/include/asm/pgtable.h
@@ -45,7 +45,7 @@ struct vm_area_struct;
45#define PTRS_PER_PMD (1UL << (PAGE_SHIFT-3)) 45#define PTRS_PER_PMD (1UL << (PAGE_SHIFT-3))
46#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) 46#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3))
47#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 47#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
48#define FIRST_USER_ADDRESS 0 48#define FIRST_USER_ADDRESS 0UL
49 49
50/* Number of pointers that fit on a page: this will go away. */ 50/* Number of pointers that fit on a page: this will go away. */
51#define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3)) 51#define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3))
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index bdc8ccaf390d..ffed3b2cf313 100644
--- a/arch/arc/include/asm/pgtable.h
+++ b/arch/arc/include/asm/pgtable.h
@@ -211,7 +211,7 @@
211 * No special requirements for lowest virtual address we permit any user space 211 * No special requirements for lowest virtual address we permit any user space
212 * mapping to be mapped at. 212 * mapping to be mapped at.
213 */ 213 */
214#define FIRST_USER_ADDRESS 0 214#define FIRST_USER_ADDRESS 0UL
215 215
216 216
217/**************************************************************** 217/****************************************************************
diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index c35e53ee6663..add094d09e3e 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -85,7 +85,7 @@ extern unsigned int kobjsize(const void *objp);
85#define VMALLOC_START 0UL 85#define VMALLOC_START 0UL
86#define VMALLOC_END 0xffffffffUL 86#define VMALLOC_END 0xffffffffUL
87 87
88#define FIRST_USER_ADDRESS (0) 88#define FIRST_USER_ADDRESS 0UL
89 89
90#include <asm-generic/pgtable.h> 90#include <asm-generic/pgtable.h>
91 91
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 4c445057169d..3e4d3c43632a 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -45,7 +45,7 @@
45 45
46#define vmemmap ((struct page *)(VMALLOC_END + SZ_64K)) 46#define vmemmap ((struct page *)(VMALLOC_END + SZ_64K))
47 47
48#define FIRST_USER_ADDRESS 0 48#define FIRST_USER_ADDRESS 0UL
49 49
50#ifndef __ASSEMBLY__ 50#ifndef __ASSEMBLY__
51extern void __pte_error(const char *file, int line, unsigned long val); 51extern void __pte_error(const char *file, int line, unsigned long val);
diff --git a/arch/avr32/include/asm/pgtable.h b/arch/avr32/include/asm/pgtable.h
index ac7a817e2126..35800664076e 100644
--- a/arch/avr32/include/asm/pgtable.h
+++ b/arch/avr32/include/asm/pgtable.h
@@ -30,7 +30,7 @@
30#define PGDIR_MASK (~(PGDIR_SIZE-1)) 30#define PGDIR_MASK (~(PGDIR_SIZE-1))
31 31
32#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 32#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
33#define FIRST_USER_ADDRESS 0 33#define FIRST_USER_ADDRESS 0UL
34 34
35#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 36extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
diff --git a/arch/cris/include/asm/pgtable.h b/arch/cris/include/asm/pgtable.h
index e824257971c4..ceefc314d64d 100644
--- a/arch/cris/include/asm/pgtable.h
+++ b/arch/cris/include/asm/pgtable.h
@@ -67,7 +67,7 @@ extern void paging_init(void);
67 */ 67 */
68 68
69#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 69#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
70#define FIRST_USER_ADDRESS 0 70#define FIRST_USER_ADDRESS 0UL
71 71
72/* zero page used for uninitialized stuff */ 72/* zero page used for uninitialized stuff */
73#ifndef __ASSEMBLY__ 73#ifndef __ASSEMBLY__
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index c49699d5902d..93bcf2abd1a1 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -140,7 +140,7 @@ extern unsigned long empty_zero_page;
140#define PTRS_PER_PTE 4096 140#define PTRS_PER_PTE 4096
141 141
142#define USER_PGDS_IN_LAST_PML4 (TASK_SIZE / PGDIR_SIZE) 142#define USER_PGDS_IN_LAST_PML4 (TASK_SIZE / PGDIR_SIZE)
143#define FIRST_USER_ADDRESS 0 143#define FIRST_USER_ADDRESS 0UL
144 144
145#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 145#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
146#define KERNEL_PGD_PTRS (PTRS_PER_PGD - USER_PGD_PTRS) 146#define KERNEL_PGD_PTRS (PTRS_PER_PGD - USER_PGD_PTRS)
diff --git a/arch/hexagon/include/asm/pgtable.h b/arch/hexagon/include/asm/pgtable.h
index 6e35e71d2aea..49eab8136ec3 100644
--- a/arch/hexagon/include/asm/pgtable.h
+++ b/arch/hexagon/include/asm/pgtable.h
@@ -171,7 +171,7 @@ extern unsigned long _dflt_cache_att;
171extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* located in head.S */ 171extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* located in head.S */
172 172
173/* Seems to be zero even in architectures where the zero page is firewalled? */ 173/* Seems to be zero even in architectures where the zero page is firewalled? */
174#define FIRST_USER_ADDRESS 0 174#define FIRST_USER_ADDRESS 0UL
175#define pte_special(pte) 0 175#define pte_special(pte) 0
176#define pte_mkspecial(pte) (pte) 176#define pte_mkspecial(pte) (pte)
177 177
diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h
index 2f07bb3dda91..7b6f8801df57 100644
--- a/arch/ia64/include/asm/pgtable.h
+++ b/arch/ia64/include/asm/pgtable.h
@@ -127,7 +127,7 @@
127#define PTRS_PER_PGD_SHIFT PTRS_PER_PTD_SHIFT 127#define PTRS_PER_PGD_SHIFT PTRS_PER_PTD_SHIFT
128#define PTRS_PER_PGD (1UL << PTRS_PER_PGD_SHIFT) 128#define PTRS_PER_PGD (1UL << PTRS_PER_PGD_SHIFT)
129#define USER_PTRS_PER_PGD (5*PTRS_PER_PGD/8) /* regions 0-4 are user regions */ 129#define USER_PTRS_PER_PGD (5*PTRS_PER_PGD/8) /* regions 0-4 are user regions */
130#define FIRST_USER_ADDRESS 0 130#define FIRST_USER_ADDRESS 0UL
131 131
132/* 132/*
133 * All the normal masks have the "page accessed" bits on, as any time 133 * All the normal masks have the "page accessed" bits on, as any time
diff --git a/arch/m32r/include/asm/pgtable.h b/arch/m32r/include/asm/pgtable.h
index 050f7a686e3d..8c1fb902a9ce 100644
--- a/arch/m32r/include/asm/pgtable.h
+++ b/arch/m32r/include/asm/pgtable.h
@@ -53,7 +53,7 @@ extern unsigned long empty_zero_page[1024];
53#define PGDIR_MASK (~(PGDIR_SIZE - 1)) 53#define PGDIR_MASK (~(PGDIR_SIZE - 1))
54 54
55#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 55#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
56#define FIRST_USER_ADDRESS 0 56#define FIRST_USER_ADDRESS 0UL
57 57
58#ifndef __ASSEMBLY__ 58#ifndef __ASSEMBLY__
59/* Just any arbitrary offset to the start of the vmalloc VM area: the 59/* Just any arbitrary offset to the start of the vmalloc VM area: the
diff --git a/arch/m68k/include/asm/pgtable_mm.h b/arch/m68k/include/asm/pgtable_mm.h
index 9f5abbda1ea7..28a145bfbb71 100644
--- a/arch/m68k/include/asm/pgtable_mm.h
+++ b/arch/m68k/include/asm/pgtable_mm.h
@@ -66,7 +66,7 @@
66#define PTRS_PER_PGD 128 66#define PTRS_PER_PGD 128
67#endif 67#endif
68#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 68#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
69#define FIRST_USER_ADDRESS 0 69#define FIRST_USER_ADDRESS 0UL