Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbbFDHJf (ORCPT ); Thu, 4 Jun 2015 03:09:35 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:34504 "EHLO e23smtp02.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769AbbFDHJ1 (ORCPT ); Thu, 4 Jun 2015 03:09:27 -0400 Date: Thu, 4 Jun 2015 15:07:18 +0800 From: Wei Yang To: Ingo Molnar Cc: Wei Yang , yinghai@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86, setup: code clean of e820_reserve_setup_data() Message-ID: <20150604070718.GA28182@richard> Reply-To: Wei Yang References: <1433384326-16863-1-git-send-email-weiyang@linux.vnet.ibm.com> <20150604054238.GA6770@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150604054238.GA6770@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15060407-0005-0000-0000-000001E93069 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1666 Lines: 62 On Thu, Jun 04, 2015 at 07:42:38AM +0200, Ingo Molnar wrote: > >* Wei Yang wrote: > >> pa_data and found are highly related, so there is no need to set a found >> flag. >> >> This patch removes the found and just return when pa_data is NULL. >> >> Signed-off-by: Wei Yang >> --- >> arch/x86/kernel/setup.c | 7 +++---- >> 1 file changed, 3 insertions(+), 4 deletions(-) >> >> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c >> index 0a2421c..b95e653 100644 >> --- a/arch/x86/kernel/setup.c >> +++ b/arch/x86/kernel/setup.c >> @@ -461,19 +461,18 @@ static void __init e820_reserve_setup_data(void) >> { >> struct setup_data *data; >> u64 pa_data; >> - int found = 0; >> >> pa_data = boot_params.hdr.setup_data; >> + if (!pa_data) >> + return; >> + >> while (pa_data) { >> data = early_memremap(pa_data, sizeof(*data)); >> e820_update_range(pa_data, sizeof(*data)+data->len, >> E820_RAM, E820_RESERVED_KERN); >> - found = 1; >> pa_data = data->next; >> early_iounmap(data, sizeof(*data)); >> } >> - if (!found) >> - return; >> >> sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); >> memcpy(&e820_saved, &e820, sizeof(struct e820map)); > >This patch does not apply to Linus's latest tree. Thanks Ingo. Rebased on top of v4.1-rc6. > >Thanks, > > Ingo -- Richard Yang Help you, Help me -- 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/