Skip to content

Commit 69550d4

Browse files
VidosKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent ca37e57 commit 69550d4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/boot/compressed/kaslr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size)
171171
static void mem_avoid_memmap(char *str)
172172
{
173173
static int i;
174-
int rc;
175174

176175
if (i >= MAX_MEMMAP_REGIONS)
177176
return;
@@ -219,7 +218,7 @@ static int handle_mem_memmap(void)
219218
return 0;
220219

221220
tmp_cmdline = malloc(len + 1);
222-
if (!tmp_cmdline )
221+
if (!tmp_cmdline)
223222
error("Failed to allocate space for tmp_cmdline");
224223

225224
memcpy(tmp_cmdline, args, len);
@@ -363,7 +362,7 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
363362
cmd_line |= boot_params->hdr.cmd_line_ptr;
364363
/* Calculate size of cmd_line. */
365364
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++];)
367366
;
368367
mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line;
369368
mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size;

0 commit comments

Comments
 (0)