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

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

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

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to