Re: [PATCH] cpuidle/cpuidle-big_little: fix reading cpu id part number
From: Russell King - ARM Linux
Date: Wed Aug 13 2014 - 06:44:46 EST
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.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/