lkml.org 
[lkml]   [2017]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4/4] kaslr: clean up a useless variable and some usless space
    Date
    There are two same variable "rc" in this function. One is in the
    circulation, the other is out of the circulation. The one out will never
    be used, so drop it.

    Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
    ---
    arch/x86/boot/compressed/kaslr.c | 5 ++---
    1 file changed, 2 insertions(+), 3 deletions(-)

    diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
    index 22330cbe8515..8a33ed82fd0b 100644
    --- a/arch/x86/boot/compressed/kaslr.c
    +++ b/arch/x86/boot/compressed/kaslr.c
    @@ -198,7 +198,6 @@ static int parse_immovable_mem(char *p,
    static void mem_avoid_memmap(char *str)
    {
    static int i;
    - int rc;

    if (i >= MAX_MEMMAP_REGIONS)
    return;
    @@ -277,7 +276,7 @@ static int handle_mem_memmap(void)
    return 0;

    tmp_cmdline = malloc(len + 1);
    - if (!tmp_cmdline )
    + if (!tmp_cmdline)
    error("Failed to allocate space for tmp_cmdline");

    memcpy(tmp_cmdline, args, len);
    @@ -423,7 +422,7 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
    cmd_line |= boot_params->hdr.cmd_line_ptr;
    /* Calculate size of cmd_line. */
    ptr = (char *)(unsigned long)cmd_line;
    - for (cmd_line_size = 0; ptr[cmd_line_size++]; )
    + for (cmd_line_size = 0; ptr[cmd_line_size++];)
    ;
    mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line;
    mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size;
    --
    2.13.6


    \
     
     \ /
      Last update: 2017-10-22 17:22    [W:3.245 / U:0.892 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site