sh: use PFN_DOWN macro
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Fri, 4 Sep 2015 22:43:35 +0000 (15:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Sep 2015 23:54:41 +0000 (16:54 -0700)
Replace ((x) >> PAGE_SHIFT) with the predefined PFN_DOWN macro.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/sh/mm/init.c
arch/sh/mm/numa.c

index 2790b6a64157f79663fe5232afe9f857e6d81cb7..17f486233db03c4d6d14d4c283b2699a73b60caa 100644 (file)
@@ -488,7 +488,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 int arch_add_memory(int nid, u64 start, u64 size)
 {
        pg_data_t *pgdat;
-       unsigned long start_pfn = start >> PAGE_SHIFT;
+       unsigned long start_pfn = PFN_DOWN(start);
        unsigned long nr_pages = size >> PAGE_SHIFT;
        int ret;
 
@@ -517,7 +517,7 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #ifdef CONFIG_MEMORY_HOTREMOVE
 int arch_remove_memory(u64 start, u64 size)
 {
-       unsigned long start_pfn = start >> PAGE_SHIFT;
+       unsigned long start_pfn = PFN_DOWN(start);
        unsigned long nr_pages = size >> PAGE_SHIFT;
        struct zone *zone;
        int ret;
index bce52ba66206f6a3cd5c958239ec0cd8ba98d7aa..05713d190247c6842907a35c8f72b856ab1ce2dd 100644 (file)
@@ -33,8 +33,8 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
        /* Don't allow bogus node assignment */
        BUG_ON(nid >= MAX_NUMNODES || nid <= 0);
 
-       start_pfn = start >> PAGE_SHIFT;
-       end_pfn = end >> PAGE_SHIFT;
+       start_pfn = PFN_DOWN(start);
+       end_pfn = PFN_DOWN(end);
 
        pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
                         PAGE_KERNEL);