Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2042183ybl; Sat, 14 Dec 2019 05:04:49 -0800 (PST) X-Google-Smtp-Source: APXvYqw8WMMAONM8V6EYXixq8T4YvTYnyKqNYMkJJfWlvmdyvBUjyZ2/k3nct8anb0EiMRkYHHP3 X-Received: by 2002:aca:d610:: with SMTP id n16mr8508470oig.108.1576328688796; Sat, 14 Dec 2019 05:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576328688; cv=none; d=google.com; s=arc-20160816; b=RnAfwT3A7uZ8WdglI78UU1Wz/vxyTezEgUIKA0kQz2p4zBNth8lzSW4TVFjmxr5qv4 1RqXqITnTMDH3hvk3C+6V5iHkZw9wu+dgzzwMkbGBbVrIpYlEPAoCgYFHXLYqASL6DND F/s5TQwtKLpBuP9nt/GBjbOThHWr6EtwcnvdTrNXxsGuuNhg1sQI+7XBSgW8yQZgXZb4 E65hNAsPWgHN7iK3OnnZQC+y8AyUUMFTP1Sgj2kqLZA0H2JDxSKxV8uDvkyn1PSaK86P o/QIyhKAOQSJ4dygZ0FWOwAsjrd2BgcQlj39JMAiYz5xeU5kkDSX0aYYF1p2spKSZmFc jQLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=3buG4a2R53sWae3DIYSl3+HdbE08DUhXIWq893hzdzA=; b=Zz8jRAHPHTIvJoMxnkRJJUgB+BBt6niM8aIY3BkiBxg4d1s/S6YMfNtXIQMyyKfCDW 5d9nNyckktdqQkENvWLD+arK8JkqKrurCc6Mgy7kjATytiuj2vSHMKgn4EQmhMaEWg48 NdWJZbNJ85evQudlkWw6S+gLugGrDxvuo5yw4k45F3u+6WgQKarn8Clupv82aGSp0lTc xeD7TGZG9C7Fp2ALY4+rVangFiawY91S0bYUIqMr922VHiFjL3TeMw08xCtvdJpDGQXV EJEF7rC2WvEiPC/zhCCU4xxwawlJJYeM4Q3oPytXY/dK797qD0kWgD5bWdgeea4xUaJL RKNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v76si6740449oif.207.2019.12.14.05.03.59; Sat, 14 Dec 2019 05:04:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfLNM6k (ORCPT + 99 others); Sat, 14 Dec 2019 07:58:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:59496 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725975AbfLNM6k (ORCPT ); Sat, 14 Dec 2019 07:58:40 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 65A29ADEB; Sat, 14 Dec 2019 12:58:38 +0000 (UTC) Date: Sat, 14 Dec 2019 13:58:31 +0100 From: Borislav Petkov To: Zhenzhong Duan Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, fanc.fnst@cn.fujitsu.com, ardb@kernel.org, dave.hansen@linux.intel.com, dan.j.williams@intel.com Subject: Re: [PATCH] x86/boot/KASLR: Fix unused variable warning Message-ID: <20191214125831.GA29335@zn.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 11, 2019 at 09:04:17PM +0800, Zhenzhong Duan wrote: > This patch fixes below warning by moving variable 'i': Avoid having "This patch" or "This commit" in the commit message. It is tautologically useless. Also, do $ git grep 'This patch' Documentation/process for more details. > arch/x86/boot/compressed/kaslr.c:698:6: warning: unused variable ‘i’ > [-Wunused-variable] You could explain here why the warning fires... > Also use true/false instead of 1/0 for boolean return. > > Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the > kernel in immovable memory only") > Signed-off-by: Zhenzhong Duan > --- > arch/x86/boot/compressed/kaslr.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) WARNING: please, no spaces at the start of a line #45: FILE: arch/x86/boot/compressed/kaslr.c:707: + return true;$ WARNING: please, no spaces at the start of a line #48: FILE: arch/x86/boot/compressed/kaslr.c:709: + return false;$ WARNING: please, no spaces at the start of a line #52: FILE: arch/x86/boot/compressed/kaslr.c:713: + int i;$ ERROR: patch seems to be corrupt (line wrapped?) #60: FILE: arch/x86/boot/compressed/kaslr.c:736: regions(slot_areas full)!\n"); WARNING: please, no spaces at the start of a line #62: FILE: arch/x86/boot/compressed/kaslr.c:737: + return true;$ WARNING: please, no spaces at the start of a line #67: FILE: arch/x86/boot/compressed/kaslr.c:741: + return false;$ $ test-apply.sh /tmp/zhenzhong.duan.01 checking file arch/x86/boot/compressed/kaslr.c patch: **** malformed patch at line 60: regions(slot_areas full)!\n"); I'd be very interested to know how you even managed to create such a well, hm, "patch"?! For the future, before you send a patch: - use checkpatch on it - send it to yourself and try applying it first Thx. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg