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/sparc | |
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/sparc')
-rw-r--r-- | arch/sparc/include/asm/pgtable_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/pgtable_64.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h index 9912eb0b499a..f06b36a00a3b 100644 --- a/arch/sparc/include/asm/pgtable_32.h +++ b/arch/sparc/include/asm/pgtable_32.h | |||
@@ -44,7 +44,7 @@ unsigned long __init bootmem_init(unsigned long *pages_avail); | |||
44 | #define PTRS_PER_PMD SRMMU_PTRS_PER_PMD | 44 | #define PTRS_PER_PMD SRMMU_PTRS_PER_PMD |
45 | #define PTRS_PER_PGD SRMMU_PTRS_PER_PGD | 45 | #define PTRS_PER_PGD SRMMU_PTRS_PER_PGD |
46 | #define USER_PTRS_PER_PGD PAGE_OFFSET / SRMMU_PGDIR_SIZE | 46 | #define USER_PTRS_PER_PGD PAGE_OFFSET / SRMMU_PGDIR_SIZE |
47 | #define FIRST_USER_ADDRESS 0 | 47 | #define FIRST_USER_ADDRESS 0UL |
48 | #define PTE_SIZE (PTRS_PER_PTE*4) | 48 | #define PTE_SIZE (PTRS_PER_PTE*4) |
49 | 49 | ||
50 | #define PAGE_NONE SRMMU_PAGE_NONE | 50 | #define PAGE_NONE SRMMU_PAGE_NONE |
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 2ac7873ad6fd..dc165ebdf05a 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h | |||
@@ -93,7 +93,7 @@ bool kern_addr_valid(unsigned long addr); | |||
93 | #define PTRS_PER_PGD (1UL << PGDIR_BITS) | 93 | #define PTRS_PER_PGD (1UL << PGDIR_BITS) |
94 | 94 | ||
95 | /* Kernel has a separate 44bit address space. */ | 95 | /* Kernel has a separate 44bit address space. */ |
96 | #define FIRST_USER_ADDRESS 0 | 96 | #define FIRST_USER_ADDRESS 0UL |
97 | 97 | ||
98 | #define pmd_ERROR(e) \ | 98 | #define pmd_ERROR(e) \ |
99 | pr_err("%s:%d: bad pmd %p(%016lx) seen at (%pS)\n", \ | 99 | pr_err("%s:%d: bad pmd %p(%016lx) seen at (%pS)\n", \ |