linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m68k/coldfire: use PFN_DOWN macro
@ 2015-08-11 16:57 Alexander Kuleshov
  2015-08-11 17:45 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kuleshov @ 2015-08-11 16:57 UTC (permalink / raw)
  To: Greg Ungerer, Geert Uytterhoeven
  Cc: linux-m68k, linux-kernel, Alexander Kuleshov

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

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/m68k/coldfire/m54xx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/coldfire/m54xx.c b/arch/m68k/coldfire/m54xx.c
index 075aaab..f7836c6 100644
--- a/arch/m68k/coldfire/m54xx.c
+++ b/arch/m68k/coldfire/m54xx.c
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k/coldfire: use PFN_DOWN macro
  2015-08-11 16:57 [PATCH] m68k/coldfire: use PFN_DOWN macro Alexander Kuleshov
@ 2015-08-11 17:45 ` Geert Uytterhoeven
  2015-08-11 18:09   ` Alexander Kuleshov
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2015-08-11 17:45 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: Greg Ungerer, linux-m68k, linux-kernel

Hi Alexander,

On Tue, Aug 11, 2015 at 6:57 PM, Alexander Kuleshov
<kuleshovmail@gmail.com> wrote:
> Replace ((x) >> PAGE_SHIFT) with the predefined PFN_DOWN macro.
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/m68k/coldfire/m54xx.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/m68k/coldfire/m54xx.c b/arch/m68k/coldfire/m54xx.c
> index 075aaab..f7836c6 100644
> --- a/arch/m68k/coldfire/m54xx.c
> +++ b/arch/m68k/coldfire/m54xx.c
> @@ -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)

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

>         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;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k/coldfire: use PFN_DOWN macro
  2015-08-11 17:45 ` Geert Uytterhoeven
@ 2015-08-11 18:09   ` Alexander Kuleshov
  2015-08-11 19:02     ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kuleshov @ 2015-08-11 18:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Greg Ungerer, linux-m68k, linux-kernel

On 08-11-15, Geert Uytterhoeven wrote:
> Hi Alexander,
> 
> On Tue, Aug 11, 2015 at 6:57 PM, Alexander Kuleshov
> <kuleshovmail@gmail.com> wrote:
> > Replace ((x) >> PAGE_SHIFT) with the predefined PFN_DOWN macro.
> >
> > Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> > ---
> >  arch/m68k/coldfire/m54xx.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/m68k/coldfire/m54xx.c b/arch/m68k/coldfire/m54xx.c
> > index 075aaab..f7836c6 100644
> > --- a/arch/m68k/coldfire/m54xx.c
> > +++ b/arch/m68k/coldfire/m54xx.c
> > @@ -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)
> 
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k/coldfire: use PFN_DOWN macro
  2015-08-11 18:09   ` Alexander Kuleshov
@ 2015-08-11 19:02     ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2015-08-11 19:02 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: Greg Ungerer, linux-m68k, linux-kernel

On Tue, Aug 11, 2015 at 8:09 PM, Alexander Kuleshov
<kuleshovmail@gmail.com> wrote:
>> > @@ -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.

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

Indeed.

> 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 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-11 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-11 16:57 [PATCH] m68k/coldfire: use PFN_DOWN macro Alexander Kuleshov
2015-08-11 17:45 ` Geert Uytterhoeven
2015-08-11 18:09   ` Alexander Kuleshov
2015-08-11 19:02     ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).