Skip to content

Commit

Permalink
sh: use PFN_DOWN macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Kuleshov authored and Linus Torvalds committed Sep 4, 2015
1 parent 917520e commit 81cf09e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 81cf09e

Please sign in to comment.