aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Fan <fanc.fnst@cn.fujitsu.com>2017-11-23 04:08:47 -0500
committerThomas Gleixner <tglx@linutronix.de>2017-11-23 14:17:59 -0500
commit69550d41ff9c884c6d996fca41037974b2255852 (patch)
treebdb4e889854a5883f8c51ca0a32582dcadc1e9b8
parentca37e57bbe0cf1455ea3e84eb89ed04a132d59e1 (diff)
x86/boot/KASLR: Remove unused variable
There are two variables "rc" in mem_avoid_memmap. One at the top of the function and another one inside the while() loop. Drop the outer one as it is unused. Cleanup some whitespace damage while at it. Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: gregkh@linuxfoundation.org Cc: n-horiguchi@ah.jp.nec.com Cc: keescook@chromium.org Link: https://lkml.kernel.org/r/20171123090847.15293-1-fanc.fnst@cn.fujitsu.com
-rw-r--r--arch/x86/boot/compressed/kaslr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index a63fbc25ce84..8199a6187251 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -171,7 +171,6 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
171static void mem_avoid_memmap(char *str) 171static void mem_avoid_memmap(char *str)
172{ 172{
173 static int i; 173 static int i;
174 int rc;
175 174
176 if (i >= MAX_MEMMAP_REGIONS) 175 if (i >= MAX_MEMMAP_REGIONS)
177 return; 176 return;
@@ -219,7 +218,7 @@ static int handle_mem_memmap(void)
219 return 0; 218 return 0;
220 219
221 tmp_cmdline = malloc(len + 1); 220 tmp_cmdline = malloc(len + 1);
222 if (!tmp_cmdline ) 221 if (!tmp_cmdline)
223 error("Failed to allocate space for tmp_cmdline"); 222 error("Failed to allocate space for tmp_cmdline");
224 223
225 memcpy(tmp_cmdline, args, len); 224 memcpy(tmp_cmdline, args, len);
@@ -363,7 +362,7 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
363 cmd_line |= boot_params->hdr.cmd_line_ptr; 362 cmd_line |= boot_params->hdr.cmd_line_ptr;
364 /* Calculate size of cmd_line. */ 363 /* Calculate size of cmd_line. */
365 ptr = (char *)(unsigned long)cmd_line; 364 ptr = (char *)(unsigned long)cmd_line;
366 for (cmd_line_size = 0; ptr[cmd_line_size++]; ) 365 for (cmd_line_size = 0; ptr[cmd_line_size++];)
367 ; 366 ;
368 mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line; 367 mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line;
369 mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size; 368 mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size;