From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338AbdKWT0A (ORCPT ); Thu, 23 Nov 2017 14:26:00 -0500 Received: from terminus.zytor.com ([65.50.211.136]:58821 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948AbdKWTZ6 (ORCPT ); Thu, 23 Nov 2017 14:25:58 -0500 Date: Thu, 23 Nov 2017 11:24:48 -0800 From: tip-bot for Chao Fan Message-ID: Cc: hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, fanc.fnst@cn.fujitsu.com, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, fanc.fnst@cn.fujitsu.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com In-Reply-To: <20171123090847.15293-1-fanc.fnst@cn.fujitsu.com> References: <20171123090847.15293-1-fanc.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/boot/KASLR: Remove unused variable Git-Commit-ID: 69550d41ff9c884c6d996fca41037974b2255852 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 69550d41ff9c884c6d996fca41037974b2255852 Gitweb: https://git.kernel.org/tip/69550d41ff9c884c6d996fca41037974b2255852 Author: Chao Fan AuthorDate: Thu, 23 Nov 2017 17:08:47 +0800 Committer: Thomas Gleixner CommitDate: Thu, 23 Nov 2017 20:17:59 +0100 x86/boot/KASLR: Remove unused variable There are two variables "rc" in mem_avoid_memmap. One at the top of the function and another one inside the while() loop. Drop the outer one as it is unused. Cleanup some whitespace damage while at it. Signed-off-by: Chao Fan Signed-off-by: Thomas Gleixner Cc: gregkh@linuxfoundation.org Cc: n-horiguchi@ah.jp.nec.com Cc: keescook@chromium.org Link: https://lkml.kernel.org/r/20171123090847.15293-1-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 a63fbc2..8199a61 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -171,7 +171,6 @@ parse_memmap(char *p, unsigned long long *start, unsigned long long *size) static void mem_avoid_memmap(char *str) { static int i; - int rc; if (i >= MAX_MEMMAP_REGIONS) return; @@ -219,7 +218,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); @@ -363,7 +362,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;