Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1158285 > unrolled thread

[PATCH] x86, setup: code clean of e820_reserve_setup_data()

Started byWei Yang <weiyang@linux.vnet.ibm.com>
First post2015-06-04 08:30 +0200
Last post2015-06-04 08:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] x86, setup: code clean of e820_reserve_setup_data() Wei Yang <weiyang@linux.vnet.ibm.com> - 2015-06-04 08:30 +0200

#1158285 — [PATCH] x86, setup: code clean of e820_reserve_setup_data()

FromWei Yang <weiyang@linux.vnet.ibm.com>
Date2015-06-04 08:30 +0200
Subject[PATCH] x86, setup: code clean of e820_reserve_setup_data()
Message-ID<pxwP8-y3-9@gated-at.bofh.it>
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 <weiyang@linux.vnet.ibm.com>
---
 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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web