The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: tip-bot for Wei Yang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/boot] x86/boot/setup: Clean up the e820_reserve_setup_data() code
Date: Sun, 7 Jun 2015 01:33:08 -0700	[thread overview]
Message-ID: <tip-f2af7d25b4aa5b01203cc76e7530ea7fd18864a0@git.kernel.org> (raw)
In-Reply-To: <1433398729-8314-1-git-send-email-weiyang@linux.vnet.ibm.com>

Commit-ID:  f2af7d25b4aa5b01203cc76e7530ea7fd18864a0
Gitweb:     http://git.kernel.org/tip/f2af7d25b4aa5b01203cc76e7530ea7fd18864a0
Author:     Wei Yang <weiyang@linux.vnet.ibm.com>
AuthorDate: Thu, 4 Jun 2015 14:18:49 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
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 <weiyang@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1433398729-8314-1-git-send-email-weiyang@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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));

      reply	other threads:[~2015-06-07  8:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04  2:18 [PATCH] x86, setup: code clean of e820_reserve_setup_data() Wei Yang
2015-06-04  5:42 ` Ingo Molnar
2015-06-04  7:07   ` Wei Yang
2015-06-04  6:18 ` Wei Yang
2015-06-07  8:33   ` tip-bot for Wei Yang [this message]

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=tip-f2af7d25b4aa5b01203cc76e7530ea7fd18864a0@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=weiyang@linux.vnet.ibm.com \
    --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