linux-mips
[Top] [All Lists]

Re: [loongson-dev] Re: [loongson-PATCH-v3 17/25] add a machtype kernel c

To: wuzhangjin@gmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org, Wu Zhangjin <wuzj@lemote.com>, Yan Hua <yanh@lemote.com>, Philippe Vachon <philippe@cowpig.ca>, Zhang Fuxin <zhangfx@lemote.com>, loongson-dev <loongson-dev@googlegroups.com>, Liu Junliang <liujl@lemote.com>, Erwan Lerale <erwan@thiscow.com>, Arnaud Patard <apatard@mandriva.com>
Subject: Re: [loongson-dev] Re: [loongson-PATCH-v3 17/25] add a machtype kernel command line argument
From: Zhang Le <r0bertz@gentoo.org>
Date: Thu, 11 Jun 2009 19:09:14 +0800
In-reply-to: <20090610203123.GA20906@adriano.hkcable.com.hk>
Mail-followup-to: wuzhangjin@gmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org, Wu Zhangjin <wuzj@lemote.com>, Yan Hua <yanh@lemote.com>, Philippe Vachon <philippe@cowpig.ca>, Zhang Fuxin <zhangfx@lemote.com>, loongson-dev <loongson-dev@googlegroups.com>, Liu Junliang <liujl@lemote.com>, Erwan Lerale <erwan@thiscow.com>, Arnaud Patard <apatard@mandriva.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <cover.1244120575.git.wuzj@lemote.com> <d1f4caa360114f843459dc71827b1175232a24be.1244120575.git.wuzj@lemote.com> <20090610154032.GB21877@adriano.hkcable.com.hk> <20090610203123.GA20906@adriano.hkcable.com.hk>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.19 (2009-01-05)
On 04:31 Thu 11 Jun     , Zhang Le wrote:

[...]

> 
> diff --git a/arch/mips/loongson/common/machtype.c 
> b/arch/mips/loongson/common/machtype.c
> index d469dc7..34417cf 100644
> --- a/arch/mips/loongson/common/machtype.c
> +++ b/arch/mips/loongson/common/machtype.c

[...]

> -static __init int machname_setup(char *str)
> +static __init int machtype_setup(char *str)

[...]

> -     for (index = 0;
> -          index < MACHTYPE_TOTAL;
> -          index++) {
> -             if (strstr(str, machname[index]) != NULL) {
> -                     mips_machtype = index;
> -                     return 0;
> +     for (; system_types[machtype]; machtype++)
> +             if (strstr(str, system_types[machtype])) {

There is a problem here.

Because I have used "inches" instead of "inch" in system_types, if you insist
on using "inch" when passing value to the machtype kernel parameter, this
strstr() call's two parameters should be swapped:

             if (strstr(system_types[machtype], str)) {


> +                     mips_machtype = machtype;
> +                     break;
>               }
> -     }
> -     return -1;
> +     return 0;
>  }
>  
> -__setup("machtype=", machname_setup);
> +__setup("machtype=", machtype_setup);


-- 
Zhang, Le
Gentoo/Loongson Developer
http://zhangle.is-a-geek.org
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973

Attachment: pgp4AVsXAu4RX.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>