]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mm: make FIRST_USER_ADDRESS unsigned long on all archs
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 11 Feb 2015 23:26:41 +0000 (15:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Feb 2015 01:06:03 +0000 (17:06 -0800)
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>
29 files changed:
arch/alpha/include/asm/pgtable.h
arch/arc/include/asm/pgtable.h
arch/arm/include/asm/pgtable-nommu.h
arch/arm64/include/asm/pgtable.h
arch/avr32/include/asm/pgtable.h
arch/cris/include/asm/pgtable.h
arch/frv/include/asm/pgtable.h
arch/hexagon/include/asm/pgtable.h
arch/ia64/include/asm/pgtable.h
arch/m32r/include/asm/pgtable.h
arch/m68k/include/asm/pgtable_mm.h
arch/microblaze/include/asm/pgtable.h
arch/mips/include/asm/pgtable-32.h
arch/mn10300/include/asm/pgtable.h
arch/nios2/include/asm/pgtable.h
arch/openrisc/include/asm/pgtable.h
arch/parisc/include/asm/pgtable.h
arch/powerpc/include/asm/pgtable-ppc32.h
arch/powerpc/include/asm/pgtable-ppc64.h
arch/s390/include/asm/pgtable.h
arch/score/include/asm/pgtable.h
arch/sh/include/asm/pgtable.h
arch/sparc/include/asm/pgtable_32.h
arch/sparc/include/asm/pgtable_64.h
arch/tile/include/asm/pgtable.h
arch/um/include/asm/pgtable-2level.h
arch/um/include/asm/pgtable-3level.h
arch/x86/include/asm/pgtable_types.h
arch/xtensa/include/asm/pgtable.h

index fce22cf88ee9cabedfc78f1abe1fdc171ae98f9c..a9a1195923722ffc249918fb1d10c3a588892173 100644 (file)
@@ -45,7 +45,7 @@ struct vm_area_struct;
 #define PTRS_PER_PMD   (1UL << (PAGE_SHIFT-3))
 #define PTRS_PER_PGD   (1UL << (PAGE_SHIFT-3))
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 /* Number of pointers that fit on a page:  this will go away. */
 #define PTRS_PER_PAGE  (1UL << (PAGE_SHIFT-3))
index bdc8ccaf390d5ad9142628209a0739d6c43461ef..ffed3b2cf31392d51503964c48265baf4123eafe 100644 (file)
  * No special requirements for lowest virtual address we permit any user space
  * mapping to be mapped at.
  */
-#define FIRST_USER_ADDRESS      0
+#define FIRST_USER_ADDRESS      0UL
 
 
 /****************************************************************
index c35e53ee66630dc2eb0a7f537e8df49c35645f49..add094d09e3e2cec57c85cfc13349655cb93b9c1 100644 (file)
@@ -85,7 +85,7 @@ extern unsigned int kobjsize(const void *objp);
 #define        VMALLOC_START   0UL
 #define        VMALLOC_END     0xffffffffUL
 
-#define FIRST_USER_ADDRESS      (0)
+#define FIRST_USER_ADDRESS      0UL
 
 #include <asm-generic/pgtable.h>
 
index 4c445057169d47502543d4bd72ba78b6e02b310c..3e4d3c43632a575285e451c675d46d93d38e2b9b 100644 (file)
@@ -45,7 +45,7 @@
 
 #define vmemmap                        ((struct page *)(VMALLOC_END + SZ_64K))
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #ifndef __ASSEMBLY__
 extern void __pte_error(const char *file, int line, unsigned long val);
index ac7a817e21267fa3461c7dbef8a91c34e3b9f584..35800664076e7dc19df832b78a4daa47084a8299 100644 (file)
@@ -30,7 +30,7 @@
 #define PGDIR_MASK     (~(PGDIR_SIZE-1))
 
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #ifndef __ASSEMBLY__
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
index e824257971c4dc60ef96ff2c86669ee91b39efa1..ceefc314d64d088bc2185ef37a21e36b8f0b2438 100644 (file)
@@ -67,7 +67,7 @@ extern void paging_init(void);
  */
 
 #define USER_PTRS_PER_PGD       (TASK_SIZE/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS      0
+#define FIRST_USER_ADDRESS      0UL
 
 /* zero page used for uninitialized stuff */
 #ifndef __ASSEMBLY__
index c49699d5902d21abeb892c93ed11ea39f9828a58..93bcf2abd1a15d4df394ed2a6b2d203dcbea620a 100644 (file)
@@ -140,7 +140,7 @@ extern unsigned long empty_zero_page;
 #define PTRS_PER_PTE           4096
 
 #define USER_PGDS_IN_LAST_PML4 (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define USER_PGD_PTRS          (PAGE_OFFSET >> PGDIR_SHIFT)
 #define KERNEL_PGD_PTRS                (PTRS_PER_PGD - USER_PGD_PTRS)
index 6e35e71d2aeaa3f9967f7a3146052505586dc663..49eab8136ec307d3dbcb40fd98676ccc9f2b44a8 100644 (file)
@@ -171,7 +171,7 @@ extern unsigned long _dflt_cache_att;
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];  /* located in head.S */
 
 /* Seems to be zero even in architectures where the zero page is firewalled? */
-#define FIRST_USER_ADDRESS 0
+#define FIRST_USER_ADDRESS 0UL
 #define pte_special(pte)       0
 #define pte_mkspecial(pte)     (pte)
 
index 2f07bb3dda9122b336a73cf0994501141a584de1..7b6f8801df5765e9d825727a83172cc7793a969b 100644 (file)
 #define PTRS_PER_PGD_SHIFT     PTRS_PER_PTD_SHIFT
 #define PTRS_PER_PGD           (1UL << PTRS_PER_PGD_SHIFT)
 #define USER_PTRS_PER_PGD      (5*PTRS_PER_PGD/8)      /* regions 0-4 are user regions */
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 /*
  * All the normal masks have the "page accessed" bits on, as any time
index 050f7a686e3d531fccb033ae807b7888edd1ccaf..8c1fb902a9ceaeeee6d9cb24305d7f09349a2373 100644 (file)
@@ -53,7 +53,7 @@ extern unsigned long empty_zero_page[1024];
 #define PGDIR_MASK     (~(PGDIR_SIZE - 1))
 
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #ifndef __ASSEMBLY__
 /* Just any arbitrary offset to the start of the vmalloc VM area: the
index 9f5abbda1ea72f89b0b0c6663860aab7604e11cc..28a145bfbb7151a567dd825026eac10f07845e74 100644 (file)
@@ -66,7 +66,7 @@
 #define PTRS_PER_PGD   128
 #endif
 #define USER_PTRS_PER_PGD      (TASK_SIZE/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 /* Virtual address region for use by kernel_map() */
 #ifdef CONFIG_SUN3
index c6b6af4ca2a0be80934adb720078c8e1810a3e08..e53b8532353c5b8267604005b89327114b8b7d3c 100644 (file)
@@ -72,7 +72,7 @@ extern int mem_init_done;
 #include <asm/mmu.h>
 #include <asm/page.h>
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 extern unsigned long va_to_phys(unsigned long address);
 extern pte_t *va_to_pte(unsigned long address);
index 16aa9f23e17b1e531932861c4da1294307de1eb0..a6be006b6f754072d52ff026bb77efb7f0028d31 100644 (file)
@@ -57,7 +57,7 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
 #define PTRS_PER_PTE   ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
 
 #define USER_PTRS_PER_PGD      (0x80000000UL/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define VMALLOC_START    MAP_BASE
 
index 629181ae111e5d43ec3e1c3961120b81a2b68da4..afab728ab65ecde48b3c50c78e1dd19a795ad99d 100644 (file)
@@ -65,7 +65,7 @@ extern void paging_init(void);
 #define PGDIR_MASK     (~(PGDIR_SIZE - 1))
 
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define USER_PGD_PTRS          (PAGE_OFFSET >> PGDIR_SHIFT)
 #define KERNEL_PGD_PTRS                (PTRS_PER_PGD - USER_PGD_PTRS)
index 7b292e3a3138cc93e5e30d66636030d7b0674e95..a213e8c9aad059dd10d8f8a17da5577821345a6f 100644 (file)
@@ -24,7 +24,7 @@
 #include <asm/pgtable-bits.h>
 #include <asm-generic/pgtable-nopmd.h>
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define VMALLOC_START          CONFIG_NIOS2_KERNEL_MMU_REGION_BASE
 #define VMALLOC_END            (CONFIG_NIOS2_KERNEL_REGION_BASE - 1)
index 18994ccb1185db13487851b37ecd4288d322f85c..69c7df0e142047e4ad7ddcbb04be1192cdf79b1c 100644 (file)
@@ -77,7 +77,7 @@ extern void paging_init(void);
  */
 
 #define USER_PTRS_PER_PGD       (TASK_SIZE/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS      0
+#define FIRST_USER_ADDRESS      0UL
 
 /*
  * Kernels own virtual memory area.
index 1d49a4a7749b44226e23f94fb94300b39c5c8106..8c966b2270aa6692c6f085027a8c70098b447733 100644 (file)
@@ -134,7 +134,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long);
  * pgd entries used up by user/kernel:
  */
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 /* NB: The tlb miss handlers make certain assumptions about the order */
 /*     of the following bits, so be careful (One example, bits 25-31  */
index 234e07c478032728861bb918664e48592cf0f712..e48e3292e7135cd83f241a0b7fa20402ed9ad48b 100644 (file)
@@ -45,7 +45,7 @@ extern int icache_44x_need_flush;
 #define PTRS_PER_PGD   (1 << (32 - PGDIR_SHIFT))
 
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define pte_ERROR(e) \
        pr_err("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
index b9dcc936e2d1d2df1a399283a6f95dd02fb7b3cb..d46532ccc386a380341fffa16ef40a77e0988502 100644 (file)
@@ -12,7 +12,7 @@
 #endif
 #include <asm/barrier.h>
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 /*
  * Size of EA range mapped by our pagetables.
index ffb1d8ce97aeac9e1f98d5a1d9bf1549c7d2418b..aabcd3f62d3b8e8fab71634b754be1661f43efc4 100644 (file)
@@ -99,7 +99,7 @@ extern unsigned long zero_page_mask;
 #endif /* CONFIG_64BIT */
 #define PTRS_PER_PGD   2048
 
-#define FIRST_USER_ADDRESS  0
+#define FIRST_USER_ADDRESS  0UL
 
 #define pte_ERROR(e) \
        printk("%s:%d: bad pte %p.\n", __FILE__, __LINE__, (void *) pte_val(e))
index 5170ffdea64350532105b6964999fb180c3265ed..0553e5cd5985a0a634864a3402a889491a52da91 100644 (file)
@@ -27,7 +27,7 @@ extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)];
 #define PTRS_PER_PTE   1024
 
 #define USER_PTRS_PER_PGD      (0x80000000UL/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define VMALLOC_START          (0xc0000000UL)
 
index cf434c64408dd424b55bdf0bdb629fa4f7e137fd..89c513a982fcbbd83ac87a77e0c95c32782b73e6 100644 (file)
@@ -62,7 +62,7 @@ static inline unsigned long long neff_sign_extend(unsigned long val)
 /* Entries per level */
 #define PTRS_PER_PTE   (PAGE_SIZE / (1 << PTE_MAGNITUDE))
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define PHYS_ADDR_MASK29               0x1fffffff
 #define PHYS_ADDR_MASK32               0xffffffff
index 9912eb0b499ae56764993ea165ce68dfd97f0b4a..f06b36a00a3b1eda581464d2fe9f39a8980fe17f 100644 (file)
@@ -44,7 +44,7 @@ unsigned long __init bootmem_init(unsigned long *pages_avail);
 #define PTRS_PER_PMD           SRMMU_PTRS_PER_PMD
 #define PTRS_PER_PGD           SRMMU_PTRS_PER_PGD
 #define USER_PTRS_PER_PGD      PAGE_OFFSET / SRMMU_PGDIR_SIZE
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 #define PTE_SIZE               (PTRS_PER_PTE*4)
 
 #define PAGE_NONE      SRMMU_PAGE_NONE
index 2ac7873ad6fd80bd67a0e36375cccd56806cb1e8..dc165ebdf05aef6086bf5d5c5b1dd3a85f686648 100644 (file)
@@ -93,7 +93,7 @@ bool kern_addr_valid(unsigned long addr);
 #define PTRS_PER_PGD   (1UL << PGDIR_BITS)
 
 /* Kernel has a separate 44bit address space. */
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define pmd_ERROR(e)                                                   \
        pr_err("%s:%d: bad pmd %p(%016lx) seen at (%pS)\n",             \
index bc75b6ef2e793380bca8920f5f64217f637084f8..95a4f19d16c52625e40990b2a3d9f0dc0039b84c 100644 (file)
@@ -67,7 +67,7 @@ extern void pgtable_cache_init(void);
 extern void paging_init(void);
 extern void set_page_homes(void);
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define _PAGE_PRESENT           HV_PTE_PRESENT
 #define _PAGE_HUGE_PAGE         HV_PTE_PAGE
index 7afe86035fa768a36417a02dbb9a2a76518e4f94..cfbe597524698c9234effb606aadd9ff74299085 100644 (file)
@@ -23,7 +23,7 @@
 #define PTRS_PER_PTE   1024
 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)
 #define PTRS_PER_PGD   1024
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define pte_ERROR(e) \
         printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \
index 344c559c0a1787dbab65ddcd5c66f6337ab4f6b6..2b4274e7c0955f6f96795278c30e5287d7705768 100644 (file)
@@ -41,7 +41,7 @@
 #endif
 
 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define pte_ERROR(e) \
         printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \
index 5185a4f599ec03ec495ddd45329872e298047130..3e0230c94cff1e945e965735b442ef336313e889 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/const.h>
 #include <asm/page_types.h>
 
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 
 #define _PAGE_BIT_PRESENT      0       /* is present */
 #define _PAGE_BIT_RW           1       /* writeable */
index 01b80dce9d65d297fc49afcb69b4445cf131b554..a5e929a10c20e456be08168501889abed35a9a56 100644 (file)
@@ -57,7 +57,7 @@
 #define PTRS_PER_PGD           1024
 #define PGD_ORDER              0
 #define USER_PTRS_PER_PGD      (TASK_SIZE/PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
+#define FIRST_USER_ADDRESS     0UL
 #define FIRST_USER_PGD_NR      (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
 
 /*