Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754306AbbGTS2z (ORCPT ); Mon, 20 Jul 2015 14:28:55 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:34195 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbbGTS2x (ORCPT ); Mon, 20 Jul 2015 14:28:53 -0400 MIME-Version: 1.0 In-Reply-To: <1436703522-29552-1-git-send-email-mhuang@redhat.com> References: <1436703522-29552-1-git-send-email-mhuang@redhat.com> Date: Mon, 20 Jul 2015 11:28:53 -0700 X-Google-Sender-Auth: hCBzh10vhJCgRgLVWdv55gkTrYE Message-ID: Subject: Re: [PATCH] x86/mm: Assign the initail value to the pmd_idx From: Yinghai Lu To: Minfei Huang Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Morton , Tony Luck , Wang Nan , David Vrabel , "the arch/x86 maintainers" , Linux Kernel Mailing List , Minfei Huang 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: 1202 Lines: 33 On Sun, Jul 12, 2015 at 5:18 AM, Minfei Huang wrote: > From: Minfei Huang > > The variable pmd_idx is undefined, when we try to start the loop to > calculate the page. > > Assign the proper value which indexes the start address to make it work > well. > > Signed-off-by: Minfei Huang > --- > arch/x86/mm/init_32.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c > index 8340e45..68aec42 100644 > --- a/arch/x86/mm/init_32.c > +++ b/arch/x86/mm/init_32.c > @@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end) > > vaddr = start; > pgd_idx = pgd_index(vaddr); > + pmd_idx = pmd_index(vaddr); > > for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) { > for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); Reviewed-by: Yinghai Lu -- 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/