Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964776AbbFGIeI (ORCPT ); Sun, 7 Jun 2015 04:34:08 -0400 Received: from terminus.zytor.com ([198.137.202.10]:53081 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932814AbbFGIdv (ORCPT ); Sun, 7 Jun 2015 04:33:51 -0400 Date: Sun, 7 Jun 2015 01:33:08 -0700 From: tip-bot for Wei Yang Message-ID: Cc: yinghai@kernel.org, weiyang@linux.vnet.ibm.com, peterz@infradead.org, mingo@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, bp@alien8.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com Reply-To: yinghai@kernel.org, peterz@infradead.org, weiyang@linux.vnet.ibm.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, bp@alien8.de In-Reply-To: <1433398729-8314-1-git-send-email-weiyang@linux.vnet.ibm.com> References: <1433398729-8314-1-git-send-email-weiyang@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/boot/setup: Clean up the e820_reserve_setup_data() code Git-Commit-ID: f2af7d25b4aa5b01203cc76e7530ea7fd18864a0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2058 Lines: 62 Commit-ID: f2af7d25b4aa5b01203cc76e7530ea7fd18864a0 Gitweb: http://git.kernel.org/tip/f2af7d25b4aa5b01203cc76e7530ea7fd18864a0 Author: Wei Yang AuthorDate: Thu, 4 Jun 2015 14:18:49 +0800 Committer: Ingo Molnar CommitDate: Fri, 5 Jun 2015 13:53:22 +0200 x86/boot/setup: Clean up the e820_reserve_setup_data() code Deobfuscate the 'found' logic, it can be replaced with a simple: if (!pa_data) return; and 'found' can be eliminated. Signed-off-by: Wei Yang Cc: Andrew Morton Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yinghai Lu Link: http://lkml.kernel.org/r/1433398729-8314-1-git-send-email-weiyang@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- 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)); -- 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/