]> Git Repo - linux.git/commitdiff
x86/boot/KASLR: Remove return value from handle_mem_options()
authorChao Fan <[email protected]>
Tue, 7 Aug 2018 01:57:05 +0000 (09:57 +0800)
committerIngo Molnar <[email protected]>
Mon, 10 Sep 2018 13:07:11 +0000 (15:07 +0200)
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: Dou Liyang <[email protected]>
Signed-off-by: Chao Fan <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/boot/compressed/kaslr.c

index d1e19f358b6ec5fbc5c682e02d2b36149b0aa43a..9ed9709d9947a58eb8b4ce99c7640e47ef8e0079 100644 (file)
@@ -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();
        size_t len = strlen((char *)args);
@@ -251,7 +251,7 @@ static int handle_mem_options(void)
 
        if (!strstr(args, "memmap=") && !strstr(args, "mem=") &&
                !strstr(args, "hugepages"))
-               return 0;
+               return;
 
        tmp_cmdline = malloc(len + 1);
        if (!tmp_cmdline)
@@ -269,8 +269,7 @@ static int handle_mem_options(void)
                /* Stop at -- */
                if (!val && strcmp(param, "--") == 0) {
                        warn("Only '--' specified in cmdline");
-                       free(tmp_cmdline);
-                       return -1;
+                       goto out;
                }
 
                if (!strcmp(param, "memmap")) {
@@ -283,16 +282,16 @@ static int handle_mem_options(void)
                        if (!strcmp(p, "nopentium"))
                                continue;
                        mem_size = memparse(p, &p);
-                       if (mem_size == 0) {
-                               free(tmp_cmdline);
-                               return -EINVAL;
-                       }
+                       if (mem_size == 0)
+                               goto out;
+
                        mem_limit = mem_size;
                }
        }
 
+out:
        free(tmp_cmdline);
-       return 0;
+       return;
 }
 
 /*
@@ -578,7 +577,6 @@ static void process_mem_region(struct mem_vector *entry,
                               unsigned long image_size)
 {
        struct mem_vector region, overlap;
-       struct slot_area slot_area;
        unsigned long start_orig, end;
        struct mem_vector cur_entry;
 
This page took 0.060572 seconds and 4 git commands to generate.