All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Zhenzhong Duan <zhenzhong.duan@gmail.com>
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
Date: Sat, 14 Dec 2019 13:58:31 +0100	[thread overview]
Message-ID: <20191214125831.GA29335@zn.tnic> (raw)
In-Reply-To: <CAFH1YnM_2xud4V7sAZAMWPpWP0CBHxuddAKjxHJsj9U9WfH2ww@mail.gmail.com>

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 <zhenzhong.duan@oracle.com>
> ---
>  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

  reply	other threads:[~2019-12-14 12:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 13:04 [PATCH] x86/boot/KASLR: Fix unused variable warning Zhenzhong Duan
2019-12-14 12:58 ` Borislav Petkov [this message]
2020-01-10  9:43 Zhenzhong Duan
2020-01-10  9:52 ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191214125831.GA29335@zn.tnic \
    --to=bp@suse.de \
    --cc=ardb@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=fanc.fnst@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zhenzhong.duan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.