Skip to contentSkip to conversation

m68k/coldfire: use PFN_DOWN macro

PATCH Superseded Alexander Kuleshov 2 participants 6 messages Aug 11, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k/coldfire: use PFN_DOWN macro

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

---
 arch/m68k/coldfire/m54xx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/coldfire/m54xx.c +1 -0
index 075aaab..f7836c6 100644
@@ -25,4 +25,5 @@
 #include <asm/m54xxgpt.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
+#include <linux/pfn.h>
 #endif

/***************************************************************************/
@@ -91,1 +92,1 @@ static void __init mcf54xx_bootmem_alloc(void)
m68k_memory[0].size = _ramend - _rambase;

/* compute total pages in system */
- num_pages = (_ramend - _rambase) >> PAGE_SHIFT;
+ num_pages = PFN_DOWN(_ramend - _rambase);

/* page numbers */
memstart = PAGE_ALIGN(_ramstart);
- min_low_pfn = _rambase >> PAGE_SHIFT;
- start_pfn = memstart >> PAGE_SHIFT;
- max_low_pfn = _ramend >> PAGE_SHIFT;
+ min_low_pfn = PFN_DOWN(_rambase);
+ start_pfn = PFN_DOWN(memstart);
+ max_low_pfn = PFN_DOWN(_ramend);
high_memory = (void *)_ramend;

m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
--
2.5.0

#1 lore raw

Hi Alexander,

arch/m68k/coldfire/m54xx.c static void __init mcf54xx_bootmem_alloc(void)

Quoted 20 lines · Alexander Kuleshov

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

---
 arch/m68k/coldfire/m54xx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/coldfire/m54xx.c +1 -0
index 075aaab..f7836c6 100644
@@ -25,4 +25,5 @@
 #include <asm/m54xxgpt.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
+#include <linux/pfn.h>
 #endif

/***************************************************************************/

arch/m68k/coldfire/m54xx.c +0 -0
@@ -91,1 +92,1 @@ static void __init mcf54xx_bootmem_alloc(void)

The numbers in the above line don't make sense?

Quoted 7 lines
arch/m68k/coldfire/m54xx.c +0 -0
        m68k_memory[0].size = _ramend - _rambase;
        /* compute total pages in system */
arch/m68k/coldfire/m54xx.c +1 -1
-       num_pages = (_ramend - _rambase) >> PAGE_SHIFT;
+       num_pages = PFN_DOWN(_ramend - _rambase);
 
        /* page numbers */

arch/m68k/coldfire/m54xx.c

Quoted 10 lines
arch/m68k/coldfire/m54xx.c +3 -3
        memstart = PAGE_ALIGN(_ramstart);
-       min_low_pfn = _rambase >> PAGE_SHIFT;
-       start_pfn = memstart >> PAGE_SHIFT;
-       max_low_pfn = _ramend >> PAGE_SHIFT;
+       min_low_pfn = PFN_DOWN(_rambase);
+       start_pfn = PFN_DOWN(memstart);
+       max_low_pfn = PFN_DOWN(_ramend);
        high_memory = (void *)_ramend;
 
        m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;

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

#2 lore raw
In reply to Alexander Kuleshov

Hi Alexander,

arch/m68k/coldfire/m54xx.c static void __init mcf54xx_bootmem_alloc(void)

Quoted 20 lines · Alexander Kuleshov

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

---
 arch/m68k/coldfire/m54xx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/coldfire/m54xx.c +1 -0
index 075aaab..f7836c6 100644
@@ -25,4 +25,5 @@
 #include <asm/m54xxgpt.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
+#include <linux/pfn.h>
 #endif

/***************************************************************************/

arch/m68k/coldfire/m54xx.c +0 -0
@@ -91,1 +92,1 @@ static void __init mcf54xx_bootmem_alloc(void)

The numbers in the above line don't make sense?

Quoted 7 lines
arch/m68k/coldfire/m54xx.c +0 -0
        m68k_memory[0].size = _ramend - _rambase;
        /* compute total pages in system */
arch/m68k/coldfire/m54xx.c +1 -1
-       num_pages = (_ramend - _rambase) >> PAGE_SHIFT;
+       num_pages = PFN_DOWN(_ramend - _rambase);
 
        /* page numbers */

arch/m68k/coldfire/m54xx.c

Quoted 10 lines
arch/m68k/coldfire/m54xx.c +3 -3
        memstart = PAGE_ALIGN(_ramstart);
-       min_low_pfn = _rambase >> PAGE_SHIFT;
-       start_pfn = memstart >> PAGE_SHIFT;
-       max_low_pfn = _ramend >> PAGE_SHIFT;
+       min_low_pfn = PFN_DOWN(_rambase);
+       start_pfn = PFN_DOWN(memstart);
+       max_low_pfn = PFN_DOWN(_ramend);
        high_memory = (void *)_ramend;
 
        m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;

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

#3 lore raw
Quoted 22 lines · Geert Uytterhoeven

Hi Alexander,

Quoted 18 lines · Alexander Kuleshov

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

---
 arch/m68k/coldfire/m54xx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/coldfire/m54xx.c +1 -0
index 075aaab..f7836c6 100644
@@ -25,4 +25,5 @@
 #include <asm/m54xxgpt.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
+#include <linux/pfn.h>
 #endif
Quoted 5 lines

arch/m68k/coldfire/m54xx.c static void __init mcf54xx_bootmem_alloc(void)

Quoted 2 lines

/***************************************************************************/

arch/m68k/coldfire/m54xx.c +0 -0
@@ -91,1 +92,1 @@ static void __init mcf54xx_bootmem_alloc(void)

The numbers in the above line don't make sense?

Hello Geert, Are you about -91,1 +92,1....? Or what numbers. If you are about this, sorry for noise. I've checked the patch with the git apply --check and it will return some errors.

If other things are normal I will resend correct patch.

Thank you.

#4 lore raw
In reply to Geert Uytterhoeven
Quoted 22 lines · Geert Uytterhoeven

Hi Alexander,

Quoted 18 lines · Alexander Kuleshov

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

---
 arch/m68k/coldfire/m54xx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/coldfire/m54xx.c +1 -0
index 075aaab..f7836c6 100644
@@ -25,4 +25,5 @@
 #include <asm/m54xxgpt.h>
 #ifdef CONFIG_MMU
 #include <asm/mmu_context.h>
+#include <linux/pfn.h>
 #endif
Quoted 5 lines

arch/m68k/coldfire/m54xx.c static void __init mcf54xx_bootmem_alloc(void)

Quoted 2 lines

/***************************************************************************/

arch/m68k/coldfire/m54xx.c +0 -0
@@ -91,1 +92,1 @@ static void __init mcf54xx_bootmem_alloc(void)

The numbers in the above line don't make sense?

Hello Geert, Are you about -91,1 +92,1....? Or what numbers. If you are about this, sorry for noise. I've checked the patch with the git apply --check and it will return some errors.

If other things are normal I will resend correct patch.

Thank you.

#5 lore raw
Quoted 5 lines · Alexander Kuleshov
Quoted 3 lines

Review static void __init mcf54xx_bootmem_alloc(void)

Quoted 1 line
(quoted diff) +0 -0
@@ -91,1 +92,1 @@ static void __init mcf54xx_bootmem_alloc(void)

The numbers in the above line don't make sense?

Hello Geert, Are you about -91,1 +92,1....? Or what numbers. If you are about

Yes.

Quoted 2 lines

this, sorry for noise. I've checked the patch with the git apply --check and it will return some errors.

Indeed.

Quoted 1 line

If other things are normal I will resend correct patch.

OK, awaiting the update...

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