lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 29 May 2009 22:01:29 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	linux-kernel@...r.kernel.org, mingo@...hat.com, hpa@...or.com,
	andi@...stfloor.org, seto.hidetoshi@...fujitsu.com,
	tglx@...utronix.de
Cc:	linux-tip-commits@...r.kernel.org, apw@...onical.com
Subject: Re: [tip:x86/mce3] x86, mce: trivial clean up for mce_amd_64.c

> 
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ