Thread (4 messages) 4 messages, 2 authors, 2011-05-23

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

From: Segher Boessenkool <hidden>
Date: 2011-05-23 15:49:28

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 <redacted>
Cc: Harry Ciao <redacted>
Cc: Doug Thompson <redacted>
Signed-off-by: Dmitry Eremin-Solenikov <redacted>
Acked-by: Segher Boessenkool <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help