Skip to contentSkip to conversation

SH: use PFN_DOWN macro

PATCH In review Alexander Kuleshov 2 participants 2 messages Aug 9, 2015 – Aug 10, 2015 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SH: use PFN_DOWN macro

Replace ((x) >> PAGE_SHIFT) with the predefined PFN_DOWN macro.

---
 arch/sh/mm/init.c | 4 ++--
 arch/sh/mm/numa.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/sh/mm/init.c +1 -1
index 2790b6a..17f4862 100644
@@ -488,6 +488,6 @@ 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;

arch/sh/mm/numa.c +0 -0
index bce52ba..05713d1 100644
@@ -33,2 +33,2 @@ 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);
--
2.5.0

Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Alexander Kuleshov

Replace ((x) >> PAGE_SHIFT) with the predefined PFN_DOWN macro.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds