From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Yinghai Lu <yinghai@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Zachary Amsden <zach@vmware.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] x86: introduce parse_early_param_alone() to parse param early (Was Re: linux-next: reservetop fix disables mem= )
Date: Thu, 03 Sep 2009 14:04:36 +0800 [thread overview]
Message-ID: <4A9F5C74.1040805@cn.fujitsu.com> (raw)
In-Reply-To: <20090901151720.GC5394@hack>
Américo Wang wrote:
>> +#ifdef CONFIG_CMDLINE_BOOL
>> +#ifdef CONFIG_CMDLINE_OVERRIDE
>> + strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>> +#else
>> + if (builtin_cmdline[0]) {
>> + /* append boot loader cmdline to builtin */
>> + strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
>> + strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
>> + strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>> + }
>> +#endif
>> +#endif
>
>
> This seems ugly.
>
> CMDLINE_OVERRIDE depends on CMDLINE_BOOL, right? So the outer #ifdef
> can be removed. :)
>
Thanks for your review, but I think we can't do that.
Yeah, CMDLINE_OVERRIDE depends on CMDLINE_BOOL, but we don't know whether
CONFIG_CMDLINE_BOOL is defined if CONFIG_CMDLINE_OVERRIDE is not defined,
like below:
#ifdef CONFIG_CMDLINE_OVERRIDE
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
#else
/* There have two cases:
* 1: if CONFIG_CMDLINE_BOOL is defined, it's OK
* 2: if CONFIG_CMDLINE_BOOL is not defined, builtin_cmdline
* is not defined, so, the compiler will complain with it
*/
if (builtin_cmdline[0]) {
/* append boot loader cmdline to builtin */
strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
}
#endif
Thanks,
Xiao
>
prev parent reply other threads:[~2009-09-03 6:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 16:45 linux-next: reservetop fix disables mem= Hugh Dickins
2009-08-24 17:38 ` Yinghai Lu
2009-08-24 18:27 ` Ingo Molnar
2009-08-28 19:28 ` Yinghai Lu
2009-09-06 6:56 ` Yinghai Lu
2009-09-16 0:23 ` Hugh Dickins
2009-09-19 17:55 ` Ingo Molnar
2009-09-19 18:02 ` Yinghai Lu
2009-09-19 18:07 ` Yinghai Lu
2009-09-19 18:32 ` Ingo Molnar
2009-09-19 18:33 ` [tip:x86/urgent] Revert 'x86: Fix system crash when loading with "reservetop" parameter' tip-bot for Yinghai Lu
2009-08-26 1:13 ` linux-next: reservetop fix disables mem= Xiao Guangrong
2009-09-01 7:55 ` [RFC][PATCH] x86: introduce parse_early_param_alone() to parse param early (Was Re: linux-next: reservetop fix disables mem= ) Xiao Guangrong
2009-09-01 15:17 ` Américo Wang
2009-09-03 6:04 ` Xiao Guangrong [this message]
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=4A9F5C74.1040805@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.org \
--cc=xiyou.wangcong@gmail.com \
--cc=yinghai@kernel.org \
--cc=zach@vmware.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.