[PATCH V2 2/2] cpc925_edac: support single-processor configurations

Segher Boessenkool segher at kernel.crashing.org
Tue May 24 01:50:59 EST 2011


> If second CPU is not enabled, CPC925 EDAC driver will spill out 
> warnings
> about errors on second Processor Interface. Support masking that out,
> by detecting at runtime which CPUs are present in device tree.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
> Cc: Harry Ciao <qingtao.cao at windriver.com>
> Cc: Doug Thompson <dougthompson at xmission.com>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>

Acked-by: Segher Boessenkool <segher at kernel.crashing.org>

Minor stuff...

> +	/* Get first CPU node */

Comment doesn't match code.

> +	for (cpunode = NULL;
> +	     (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {

Use a while loop instead?

> +		const u32 *reg = of_get_property(cpunode, "reg", NULL);
> +
> +		if (!strcmp(cpunode->type, "cpu") && reg != NULL)
> +			mask &= ~APIMASK_ADI(*reg);
> +	}

You might want to check if the "reg" value is < 2, you get C undefined
behaviour if it is too big (not that that should happen), and it's 
clearer
code anyway.

> +	cpumask = cpc925_cpu_getmask();

You could choose a function name that makes more clear these are the
processor _interfaces_ that are _not_ used :-)

You could cache this value as well.


Segher



More information about the Linuxppc-dev mailing list