From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752294AbdKMIck (ORCPT ); Mon, 13 Nov 2017 03:32:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbdKMIci (ORCPT ); Mon, 13 Nov 2017 03:32:38 -0500 Date: Mon, 13 Nov 2017 16:32:33 +0800 From: Baoquan He To: Chao Fan Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, keescook@chromium.org, yasu.isimatu@gmail.com, indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com, douly.fnst@cn.fujitsu.com Subject: Re: [PATCH v2 4/4] kaslr: clean up a useless variable and some usless space Message-ID: <20171113083233.GF10474@x1> References: <20171101113203.27741-1-fanc.fnst@cn.fujitsu.com> <20171101113203.27741-5-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171101113203.27741-5-fanc.fnst@cn.fujitsu.com> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 13 Nov 2017 08:32:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/01/17 at 07:32pm, Chao Fan wrote: > 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. You can send this clean up patch alone. > > Signed-off-by: Chao Fan > --- > 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 fcd640fdeaed..aff184e19270 100644 > --- a/arch/x86/boot/compressed/kaslr.c > +++ b/arch/x86/boot/compressed/kaslr.c > @@ -211,7 +211,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; > @@ -290,7 +289,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); > @@ -436,7 +435,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 > > >