Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752160AbbHKRpt (ORCPT ); Tue, 11 Aug 2015 13:45:49 -0400 Received: from mail-ob0-f171.google.com ([209.85.214.171]:34385 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbbHKRpr (ORCPT ); Tue, 11 Aug 2015 13:45:47 -0400 MIME-Version: 1.0 In-Reply-To: <1439312221-12688-1-git-send-email-kuleshovmail@gmail.com> References: <1439312221-12688-1-git-send-email-kuleshovmail@gmail.com> Date: Tue, 11 Aug 2015 19:45:47 +0200 X-Google-Sender-Auth: xhsgsH9-NJGmIfH1xSTWGEC_WWM Message-ID: Subject: Re: [PATCH] m68k/coldfire: use PFN_DOWN macro From: Geert Uytterhoeven To: Alexander Kuleshov Cc: Greg Ungerer , linux-m68k , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2097 Lines: 60 Hi Alexander, On Tue, Aug 11, 2015 at 6:57 PM, Alexander Kuleshov wrote: > Replace ((x) >> PAGE_SHIFT) with the predefined PFN_DOWN macro. > > Signed-off-by: Alexander Kuleshov > --- > 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 > #ifdef CONFIG_MMU > #include > +#include > #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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/