From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750943AbdJTELE (ORCPT ); Fri, 20 Oct 2017 00:11:04 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:30611 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750760AbdJTELD (ORCPT ); Fri, 20 Oct 2017 00:11:03 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="29402533" Date: Fri, 20 Oct 2017 12:10:37 +0800 From: Chao Fan To: Dou Liyang CC: , , , , , , , , Subject: Re: [PATCH 4/4] kaslr: clean up a useless variable and some usless space Message-ID: <20171020041037.GE5635@localhost.localdomain> References: <20171019100243.25259-1-fanc.fnst@cn.fujitsu.com> <20171019100243.25259-5-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [10.167.225.56] X-yoursite-MailScanner-ID: 61BD248029C3.A6FD9 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 20, 2017 at 11:19:48AM +0800, Dou Liyang wrote: >Hi Chao, > >At 10/19/2017 06:02 PM, 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. >> >> 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 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; Hi Dou-san, > >Seems it is redundant too, Thanks for your suggestion. Thanks, Chao Fan > >Thanks, > dou. > >> @@ -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; >>