diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2015-02-11 18:26:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 20:06:03 -0500 |
commit | d016bf7ece53b2b947bfd769e0842fd2feb7556b (patch) | |
tree | 2b419f2baa1f9b67f1a3f1b312d7a838bfb0bef0 /arch/um | |
parent | 3ae3ad4e639234a43fd3997887524d2e5345fa76 (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>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/include/asm/pgtable-2level.h | 2 | ||||
-rw-r--r-- | arch/um/include/asm/pgtable-3level.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/include/asm/pgtable-2level.h b/arch/um/include/asm/pgtable-2level.h index 7afe86035fa7..cfbe59752469 100644 --- a/arch/um/include/asm/pgtable-2level.h +++ b/arch/um/include/asm/pgtable-2level.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define PTRS_PER_PTE 1024 | 23 | #define PTRS_PER_PTE 1024 |
24 | #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) | 24 | #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) |
25 | #define PTRS_PER_PGD 1024 | 25 | #define PTRS_PER_PGD 1024 |
26 | #define FIRST_USER_ADDRESS 0 | 26 | #define FIRST_USER_ADDRESS 0UL |
27 | 27 | ||
28 | #define pte_ERROR(e) \ | 28 | #define pte_ERROR(e) \ |
29 | printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \ | 29 | printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \ |
diff --git a/arch/um/include/asm/pgtable-3level.h b/arch/um/include/asm/pgtable-3level.h index 344c559c0a17..2b4274e7c095 100644 --- a/arch/um/include/asm/pgtable-3level.h +++ b/arch/um/include/asm/pgtable-3level.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) | 43 | #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) |
44 | #define FIRST_USER_ADDRESS 0 | 44 | #define FIRST_USER_ADDRESS 0UL |
45 | 45 | ||
46 | #define pte_ERROR(e) \ | 46 | #define pte_ERROR(e) \ |
47 | printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \ | 47 | printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \ |