* Re: [tip:x86/mce3] x86, mce: trivial clean up for mce_amd_64.c
[not found] <tip-34fa1967aa0827776e37feb5666df0327575a0f2@git.kernel.org>
@ 2009-05-29 20:01 ` Andi Kleen
0 siblings, 0 replies; only message in thread
From: Andi Kleen @ 2009-05-29 20:01 UTC (permalink / raw)
To: linux-kernel, mingo, hpa, andi, seto.hidetoshi, tglx
Cc: linux-tip-commits, apw
>
> 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
^ permalink raw reply [flat|nested] only message in thread