public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>, WANG Chao <chaowang@redhat.com>,
	Vivek Goyal <vgoyal@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/4] x86, kdump: Change crashkernel_high/low= to crashkernel=,high/low
Date: Mon, 15 Apr 2013 09:20:55 +0900	[thread overview]
Message-ID: <516B47E7.7010901@jp.fujitsu.com> (raw)
In-Reply-To: <1365749691-21299-5-git-send-email-yinghai@kernel.org>

(2013/04/12 15:54), Yinghai Lu wrote:
<cut>
> Index: linux-2.6/kernel/kexec.c
> ===================================================================
> --- linux-2.6.orig/kernel/kexec.c
> +++ linux-2.6/kernel/kexec.c
> @@ -1368,35 +1368,114 @@ static int __init parse_crashkernel_simp
>   	return 0;
>   }
>   
> +#define SUFFIX_HIGH 0
> +#define SUFFIX_LOW  1
> +#define SUFFIX_NULL 2
> +static __initdata char *suffix_tbl[] = {
> +	[SUFFIX_HIGH] = ",high",
> +	[SUFFIX_LOW]  = ",low",
> +	[SUFFIX_NULL] = NULL,
> +};
> +
>   /*
> - * That function is the entry point for command line parsing and should be
> - * called from the arch-specific code.
> + * That function parses "suffix"  crashkernel command lines like
> + *
> + *	crashkernel=size,[high|low]
> + *
> + * It returns 0 on success and -EINVAL on failure.
>    */
> +static int __init parse_crashkernel_suffix(char *cmdline,
> +					   unsigned long long	*crash_size,
> +					   unsigned long long	*crash_base,
> +					   const char *suffix)
> +{
> +	char *cur = cmdline;
> +
> +	*crash_size = memparse(cmdline, &cur);
> +	if (cmdline == cur) {
> +		pr_warn("crashkernel: memory value expected\n");
> +		return -EINVAL;
> +	}
> +
> +	/* check with suffix */
> +	if (strncmp(cur, suffix, strlen(suffix))) {
> +		pr_warn("crashkernel: unrecognized char\n");
> +		return -EINVAL;
> +	}
> +	cur += strlen(suffix);
> +	if (*cur != ' ' && *cur != '\0') {
> +		pr_warn("crashkernel: unrecognized char\n");
> +		return -EINVAL;
> +	}
> +
> +	return 0;
> +}

Thanks, looks good to me.

-- 
Thanks.
HATAYAMA, Daisuke


  reply	other threads:[~2013-04-15  0:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  6:54 [PATCH -v5 0/4] x86, kdump: Fix crashkernel high with old kexec-tools Yinghai Lu
2013-04-12  6:54 ` [PATCH v5 1/4] x86, kdump: Set crashkernel_low automatically Yinghai Lu
2013-04-15  1:59   ` H. Peter Anvin
2013-04-15  2:59     ` Yinghai Lu
2013-04-15  3:26       ` H. Peter Anvin
2013-04-12  6:54 ` [PATCH v5 4/4] kexec: use Crash kernel for Crash kernel low Yinghai Lu
2013-04-12  6:54 ` [PATCH v5 2/4] x86, kdump: Retore crashkernel= to allocate under 896M Yinghai Lu
2013-04-12  6:54 ` [PATCH v5 3/4] x86, kdump: Change crashkernel_high/low= to crashkernel=,high/low Yinghai Lu
2013-04-15  0:20   ` HATAYAMA Daisuke [this message]
2013-04-12 20:07 ` [PATCH -v5 0/4] x86, kdump: Fix crashkernel high with old kexec-tools Vivek Goyal

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=516B47E7.7010901@jp.fujitsu.com \
    --to=d.hatayama@jp.fujitsu.com \
    --cc=chaowang@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=vgoyal@redhat.com \
    --cc=yinghai@kernel.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