Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752624AbbFDGVP (ORCPT ); Thu, 4 Jun 2015 02:21:15 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:43619 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbbFDGVB (ORCPT ); Thu, 4 Jun 2015 02:21:01 -0400 From: Wei Yang To: yinghai@kernel.org Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH] x86, setup: code clean of e820_reserve_setup_data() Date: Thu, 4 Jun 2015 14:18:49 +0800 Message-Id: <1433398729-8314-1-git-send-email-weiyang@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1433384326-16863-1-git-send-email-weiyang@linux.vnet.ibm.com> References: <1433384326-16863-1-git-send-email-weiyang@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15060406-0029-0000-0000-000001A863A4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 45 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 d74ac33..c3992c3 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_memunmap(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)); -- 1.7.9.5 -- 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/