Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
To: Geoff Levand <geoff@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	kexec@lists.infradead.org, Eric Biederman <ebiederm@xmission.com>
Subject: Re: [PATCH 1/4] kexec: Simplify conditional
Date: Thu, 12 Dec 2013 09:32:02 +0800	[thread overview]
Message-ID: <52A91212.9080501@cn.fujitsu.com> (raw)
In-Reply-To: <839896bb375c8b694473b0ea6a6db009c1128fc5.1386807069.git.geoff@infradead.org>

Add CCing Andrew Morton

On 12/12/2013 08:18 AM, Geoff Levand wrote:
> Simplify the code around one of the conditionals in the kexec_load
> syscall routine.
> 
> The original code was confusing with a redundant check on KEXEC_ON_CRASH
> and comments outside of the conditional block.  This change switches the
> order of the conditional check, and cleans up the comments for the
> conditional.  There is no functional change to the code.

This looks good.

Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>

minor comments below.

> 
> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
>  kernel/kexec.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index 490afc0..89a6fa3 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -980,19 +980,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
>  	if (nr_segments > 0) {
>  		unsigned long i;
>  
> -		/* Loading another kernel to reboot into */
> -		if ((flags & KEXEC_ON_CRASH) == 0)
> -			result = kimage_normal_alloc(&image, entry,
> -							nr_segments, segments);
> -		/* Loading another kernel to switch to if this one crashes */
> -		else if (flags & KEXEC_ON_CRASH) {
> -			/* Free any current crash dump kernel before
> +		if (flags & KEXEC_ON_CRASH) {
> +			/*
> +			 * Loading another kernel to switch to if this one
> +			 * crashes.  Free any current crash dump kernel before
>  			 * we corrupt it.
>  			 */
> +

This empty line is not necessary, I think. But no big deal.

>  			kimage_free(xchg(&kexec_crash_image, NULL));
>  			result = kimage_crash_alloc(&image, entry,
>  						     nr_segments, segments);
>  			crash_map_reserved_pages();
> +		} else {
> +			/* Loading another kernel to reboot into. */
> +

ditto.

> +			result = kimage_normal_alloc(&image, entry,
> +							nr_segments, segments);
>  		}
>  		if (result)
>  			goto out;
> 


-- 
Thanks.
Zhang Yanfei

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2013-12-12  2:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12  0:18 [PATCH 0/4] Minor fixes and improvements for kexec Geoff Levand
2013-12-12  0:18 ` [PATCH 4/4] sh/kexec: Fix kexec build warning Geoff Levand
2013-12-12 14:48   ` Geert Uytterhoeven
2013-12-12 19:30     ` Geoff Levand
2013-12-12  0:18 ` [PATCH 2/4] kexec: Add IND_FLAGS macro Geoff Levand
2013-12-12  1:35   ` Zhang Yanfei
2013-12-12 19:33     ` Geoff Levand
2013-12-12  0:18 ` [PATCH 1/4] kexec: Simplify conditional Geoff Levand
2013-12-12  1:32   ` Zhang Yanfei [this message]
2013-12-17  0:45     ` Andrew Morton
2013-12-12  0:18 ` [PATCH 3/4] powerpc/kexec: Use global IND_FLAGS macro Geoff Levand
2013-12-12  5:11 ` [PATCH 0/4] Minor fixes and improvements for kexec Simon Horman
2013-12-12 19:51 ` [PATCH v2 4/4] sh/kexec: Fix kexec build warning Geoff Levand
2013-12-17  5:37 ` [PATCH 0/4] Minor fixes and improvements for kexec WANG Chao

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=52A91212.9080501@cn.fujitsu.com \
    --to=zhangyanfei@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=geoff@infradead.org \
    --cc=kexec@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox