From: Andi Kleen <andi@firstfloor.org>
To: linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
andi@firstfloor.org, seto.hidetoshi@jp.fujitsu.com,
tglx@linutronix.de
Cc: linux-tip-commits@vger.kernel.org, apw@canonical.com
Subject: Re: [tip:x86/mce3] x86, mce: trivial clean up for mce_amd_64.c
Date: Fri, 29 May 2009 22:01:29 +0200 [thread overview]
Message-ID: <20090529200129.GB1065@one.firstfloor.org> (raw)
In-Reply-To: <tip-34fa1967aa0827776e37feb5666df0327575a0f2@git.kernel.org>
>
> ERROR: Macros with multiple statements should be enclosed in a do - while
> loop
That seems more like a checkpatch.pl bug -- clearly you cannot put
a do {} while loop into a declaration like here. I don't know who comes up
with these useless warnings? At least they should be made warnings,
not errors and then be ignored if they don't make any sense like this.
The change imho makes the code worse.
> +#define THRESHOLD_ATTR(_name, _mode, _show, _store) \
> +{ \
> + .attr = {.name = __stringify(_name), .mode = _mode }, \
> + .show = _show, \
> + .store = _store, \
> +};
> WARNING: usage of NR_CPUS is often wrong - consider using cpu_possible(),
> num_possible_cpus(), for_each_possible_cpu(), etc
> + if (cpu >= NR_CPUS)
In this case it's not wrong either. It's a bit paranoid, but not wrong.
NR_CPUS is only wrong when used in arrays.
-Andi
parent reply other threads:[~2009-05-29 19:54 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <tip-34fa1967aa0827776e37feb5666df0327575a0f2@git.kernel.org>]
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=20090529200129.GB1065@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=apw@canonical.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=seto.hidetoshi@jp.fujitsu.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®