[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] [PATCH] microblaze: Fix early cmdline for CMDLINE_FORCE
Steven J. Magnani wrote:
> On Thu, 2009-05-21 at 09:02 +0200, Michal Simek wrote:
>> This patch fixed parsing early parameters because
>> current implementation does that early parse DTS
>> command line and then parse CMDLINE line which is compiled-in.
>>
>> For case that DTS doesn't contain command line is
>> copied command line from kernel with is done in prom.c
>> that's why I can remove it from machine_early_init.
>>
>> Signed-off-by: Michal Simek <monstr@xxxxxxxxx>
>> ---
>> arch/microblaze/kernel/prom.c | 2 ++
>> arch/microblaze/kernel/setup.c | 13 -------------
>> 2 files changed, 2 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
>> index 34c4871..003d373 100644
>> --- a/arch/microblaze/kernel/prom.c
>> +++ b/arch/microblaze/kernel/prom.c
>> @@ -563,7 +563,9 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
>> strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
>>
>> #ifdef CONFIG_CMDLINE
>> +#ifndef CONFIG_CMDLINE_FORCE
>> if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
>> +#endif
>> strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
>> #endif /* CONFIG_CMDLINE */
>
> Nice. I can't test this though because my kernel runs without OF. But it
> looks correct.
>
>>
>> diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
>> index eb6b417..eab327c 100644
>> --- a/arch/microblaze/kernel/setup.c
>> +++ b/arch/microblaze/kernel/setup.c
>> @@ -42,10 +42,6 @@ char cmd_line[COMMAND_LINE_SIZE];
>>
>> void __init setup_arch(char **cmdline_p)
>> {
>> -#ifdef CONFIG_CMDLINE_FORCE
>> - strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
>> - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
>> -#endif
>> *cmdline_p = cmd_line;
>>
>> console_verbose();
>> @@ -106,15 +102,6 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
>> memset(__bss_start, 0, __bss_stop-__bss_start);
>> memset(_ssbss, 0, _esbss-_ssbss);
>>
>> - /*
>> - * Copy command line passed from bootloader, or use default
>> - * if none provided, or forced
>> - */
>> -#ifndef CONFIG_CMDLINE_BOOL
>> - if (cmdline && cmdline[0] != '\0')
>> - strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
>> -#endif
>> -
> Isn't this deletion removing the bootloader command line from
> consideration? I think your first patch is better. This comment needs
> updating, though, and you could probably delete the #ifndef bracket.
>
I revert it. I keep there ifndef. Please check it at
http://developer.petalogix.com/git/gitweb.cgi?p=linux-2.6-microblaze.git;a=commitdiff;h=1dff89a9c7fab71b43ba79cc1aa6c6dbad582a35
Michal
>> /* initialize device tree for usage in early_printk */
>> early_init_devtree((void *)_fdt_start);
>>
>
> ------------------------------------------------------------------------
> Steven J. Magnani "I claim this network for MARS!
> www.digidescorp.com Earthling, return my space modulator!"
>
> #include <standard.disclaimer>
>
>
>
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>
>
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/