mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Shuah Khan <shuah.khan@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	tglx@linutronix.de, "H. Peter Anvin" <hpa@zytor.com>,
	Ingo Molnar <mingo@redhat.com>,
	yinghai@kernel.org, tangchen@cn.fujitsu.com,
	wency@cn.fujitsu.com, linux-kernel@vger.kernel.org,
	x86@kernel.org, shuahkhan@gmail.com
Subject: Re: [PATCH linux-next] x86/mm: Fix compile warning in remove_pagetable()
Date: Wed, 6 Feb 2013 00:27:01 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1302060017410.6630@chino.kir.corp.google.com> (raw)
In-Reply-To: <1360119136.8356.4.camel@lorien2>

On Tue, 5 Feb 2013, Shuah Khan wrote:

> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 67bad4b..ed78400 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -987,7 +987,7 @@ remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end,
>  static void __meminit
>  remove_pagetable(unsigned long start, unsigned long end, bool direct)
>  {
> -	unsigned long next;
> +	unsigned long next = pgd_addr_end(start, end);
>  	pgd_t *pgd;
>  	pud_t *pud;
>  	bool pgd_changed = false;

This isn't enough, there's a potential for an infinite loop if 
!pgd_present() is ever true in the iteration since "next" remains 
constant.  Theoretical, maybe.

I think it's better to just set next before checking for !pgd_present() in 
the iteration so it's clear what's happening.  Or, even better, change 
this into the standard do-while loop that everything else uses.

  parent reply	other threads:[~2013-02-06  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06  2:52 Shuah Khan
2013-02-06  4:24 ` Yinghai Lu
2013-02-06  8:27 ` David Rientjes [this message]
2013-02-06  8:30   ` Tang Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1302060017410.6630@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=shuah.khan@hp.com \
    --cc=shuahkhan@gmail.com \
    --cc=tangchen@cn.fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=wency@cn.fujitsu.com \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®