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

From: Segher Boessenkool <[email-masked]>
Date: Mon, 23 May 2011 17:50:59 +0200

> 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 <[email-masked]>
> Cc: Harry Ciao <[email-masked]>
> Cc: Doug Thompson <[email-masked]>
> Signed-off-by: Dmitry Eremin-Solenikov <[email-masked]>

Acked-by: Segher Boessenkool <[email-masked]>

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