Commit 44060e8a authored by Chao Fan's avatar Chao Fan Committed by Ingo Molnar

x86/boot/KASLR: Remove return value from handle_mem_options()

It's not used by its sole user, so remove this unused functionality.

Also remove a stray unused variable that GCC didn't warn about for some reason.
Suggested-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kirill.shutemov@linux.intel.com
Link: http://lkml.kernel.org/r/20180807015705.21697-1-fanc.fnst@cn.fujitsu.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent b1e3a25f
...@@ -241,7 +241,7 @@ static void parse_gb_huge_pages(char *param, char *val) ...@@ -241,7 +241,7 @@ static void parse_gb_huge_pages(char *param, char *val)
} }
static int handle_mem_options(void) static void handle_mem_options(void)
{ {
char *args = (char *)get_cmd_line_ptr(); char *args = (char *)get_cmd_line_ptr();
size_t len = strlen((char *)args); size_t len = strlen((char *)args);
...@@ -251,7 +251,7 @@ static int handle_mem_options(void) ...@@ -251,7 +251,7 @@ static int handle_mem_options(void)
if (!strstr(args, "memmap=") && !strstr(args, "mem=") && if (!strstr(args, "memmap=") && !strstr(args, "mem=") &&
!strstr(args, "hugepages")) !strstr(args, "hugepages"))
return 0; return;
tmp_cmdline = malloc(len + 1); tmp_cmdline = malloc(len + 1);
if (!tmp_cmdline) if (!tmp_cmdline)
...@@ -269,8 +269,7 @@ static int handle_mem_options(void) ...@@ -269,8 +269,7 @@ static int handle_mem_options(void)
/* Stop at -- */ /* Stop at -- */
if (!val && strcmp(param, "--") == 0) { if (!val && strcmp(param, "--") == 0) {
warn("Only '--' specified in cmdline"); warn("Only '--' specified in cmdline");
free(tmp_cmdline); goto out;
return -1;
} }
if (!strcmp(param, "memmap")) { if (!strcmp(param, "memmap")) {
...@@ -283,16 +282,16 @@ static int handle_mem_options(void) ...@@ -283,16 +282,16 @@ static int handle_mem_options(void)
if (!strcmp(p, "nopentium")) if (!strcmp(p, "nopentium"))
continue; continue;
mem_size = memparse(p, &p); mem_size = memparse(p, &p);
if (mem_size == 0) { if (mem_size == 0)
free(tmp_cmdline); goto out;
return -EINVAL;
}
mem_limit = mem_size; mem_limit = mem_size;
} }
} }
out:
free(tmp_cmdline); free(tmp_cmdline);
return 0; return;
} }
/* /*
...@@ -578,7 +577,6 @@ static void process_mem_region(struct mem_vector *entry, ...@@ -578,7 +577,6 @@ static void process_mem_region(struct mem_vector *entry,
unsigned long image_size) unsigned long image_size)
{ {
struct mem_vector region, overlap; struct mem_vector region, overlap;
struct slot_area slot_area;
unsigned long start_orig, end; unsigned long start_orig, end;
struct mem_vector cur_entry; struct mem_vector cur_entry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment