Re: [PATCH] cpuidle/cpuidle-big_little: fix reading cpu id part number

From: Juri Lelli
Date: Wed Aug 13 2014 - 07:14:42 EST


On 13/08/14 11:44, Russell King - ARM Linux wrote:
> On Wed, Aug 13, 2014 at 11:04:13AM +0100, Juri Lelli wrote:
>> Thanks a lot for the comment. Does what below address it?
>
> Yes, thanks, but a few of nitpicks though.
>
>> +/*
>> + * smp_cpuid_part() - return part id for a given cpu
>> + *
>> + * @cpu: logical cpu id
>> + *
>> + * Return: part id of logical cpu passed as argument
>> + *
>> + */
>
> If this is supposed to be a kerneldoc-compatible comment, please read
> Documentation/kernel-doc-nano-HOWTO.txt for the correct format.
>
>> +static inline unsigned int smp_cpuid_part(int cpu)
>> +{
>> + struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpu);
>> +
>> + return is_smp() ? (cpu_info->cpuid & ARM_CPU_PART_MASK) :
>
> Parens are not required, and there's a double space before &.
>
> The BNF for the ?: operator is:
>
> cond-expr:
> log-or-expr ? expr : cond-expr
>
> So the compiler knows that whatever is between the ? and : is a single
> expression, and the parens are surplus.
>
>> -static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int cpu_id)
>> +static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int match_id)
>
> If we're changing the name, "part_id" would probably be better than the
> opaque "match_id" here.
>

Right, thanks! What follows has those fixed. Should I send it as a new post?

Thanks,

- Juri