All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Balbir Singh <bsingharora@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/64s: dt_cpu_ftrs boot time setup option
Date: Tue, 30 May 2017 15:29:34 +1000	[thread overview]
Message-ID: <87vaoi6hfl.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <1496096943.21894.13.camel@gmail.com>

Balbir Singh <bsingharora@gmail.com> writes:
> On Thu, 2017-05-11 at 21:24 +1000, Nicholas Piggin wrote:
>> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
>> index fcc7588a96d6..050925b5b451 100644
>> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c
>> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
>> @@ -671,12 +671,24 @@ static struct dt_cpu_feature_match __initdata
>>  	{"wait-v3", feat_enable, 0},
>>  };
>>  
>> -/* XXX: how to configure this? Default + boot time? */
>> -#ifdef CONFIG_PPC_CPUFEATURES_ENABLE_UNKNOWN
>> -#define CPU_FEATURE_ENABLE_UNKNOWN 1
>> -#else
>> -#define CPU_FEATURE_ENABLE_UNKNOWN 0
>> -#endif
>> +static bool __initdata using_dt_cpu_ftrs = true;
>> +static bool __initdata dt_cpu_ftrs_enable_unknown = true;
>> +
>> +static int __init dt_cpu_ftrs_parse(char *str)
>> +{
>> +	if (!str)
>> +		return 0;
>> +
>> +	if (!strcmp(str, "off"))
>> +		using_dt_cpu_ftrs = false;
>> +	else if (!strcmp(str, "known"))
>> +		dt_cpu_ftrs_enable_unknown = false;
>> +	else
>> +		return 1;
>> +
>> +	return 0;
>> +}
>> +early_param("dt_cpu_ftrs", dt_cpu_ftrs_parse);
>
> I wouldn't use strcmp with user passed parameters.

Why not? Especially considering the generic code has already parsed the
string to find the = delimiter, and is just passing us the tail.

cheers

  reply	other threads:[~2017-05-30  5:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 11:24 [PATCH] powerpc/64s: dt_cpu_ftrs boot time setup option Nicholas Piggin
2017-05-11 13:25 ` Paul Clarke
2017-05-12  3:46   ` Michael Ellerman
2017-05-12 12:32     ` Paul Clarke
2017-05-15  9:43       ` Michael Ellerman
2017-05-29 10:29 ` Michael Ellerman
2017-05-30  0:18   ` Nicholas Piggin
2017-05-30  5:32     ` Michael Ellerman
2017-05-29 22:29 ` Balbir Singh
2017-05-30  5:29   ` Michael Ellerman [this message]
2017-06-01 13:31 ` Michael Ellerman

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=87vaoi6hfl.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=bsingharora@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.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.