From: Segher Boessenkool <segher@kernel.crashing.org>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Harry Ciao <qingtao.cao@windriver.com>,
linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>,
Doug Thompson <dougthompson@xmission.com>
Subject: Re: [PATCH V2 2/2] cpc925_edac: support single-processor configurations
Date: Mon, 23 May 2011 17:50:59 +0200 [thread overview]
Message-ID: <b16a2ec616a4b9d221fb760e5d2222df@kernel.crashing.org> (raw)
In-Reply-To: <1306059295-25806-2-git-send-email-dbaryshkov@gmail.com>
> 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@gmail.com>
> Cc: Harry Ciao <qingtao.cao@windriver.com>
> Cc: Doug Thompson <dougthompson@xmission.com>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Segher Boessenkool <segher@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
next prev parent reply other threads:[~2011-05-23 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-22 10:14 [PATCH V2 1/2] Maple: register CPC925 EDAC device on all boards with CPC925 Dmitry Eremin-Solenikov
2011-05-22 10:14 ` [PATCH V2 2/2] cpc925_edac: support single-processor configurations Dmitry Eremin-Solenikov
2011-05-23 15:50 ` Segher Boessenkool [this message]
2011-05-23 15:40 ` [PATCH V2 1/2] Maple: register CPC925 EDAC device on all boards with CPC925 Segher Boessenkool
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b16a2ec616a4b9d221fb760e5d2222df@kernel.crashing.org \
--to=segher@kernel.crashing.org \
--cc=dbaryshkov@gmail.com \
--cc=dougthompson@xmission.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=qingtao.cao@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).