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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 26 Apr 2008 12:52:33 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Ingo Molnar <mingo@...e.hu>
cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, Yinghai Lu <yinghai.lu@....com>,
	Yinghai Lu <yhlu.kernel@...il.com>, jbarnes@...tuousgeek.org
Subject: Re: [git pull] "big box" x86 changes, bootmem/sparsemem



On Sat, 26 Apr 2008, Ingo Molnar wrote:
>  #ifdef CONFIG_NUMA
> +	nid = phys_to_nid(phys);
> +	next_nid = phys_to_nid(phys + len - 1);
> +	if (nid == next_nid)
>  	reserve_bootmem_node(NODE_DATA(nid), phys, len, BOOTMEM_DEFAULT);
> -#else
> -	reserve_bootmem(phys, len, BOOTMEM_DEFAULT);
> +	else
>  #endif
> +	reserve_bootmem(phys, len, BOOTMEM_DEFAULT);
> +

Noticed this when just trying to read the code to see if it looks sensible 
(without looking at any real details).

Code like this is *not* acceptable.

We do proper indentations. Improperly indented code is buggy. It doesn't 
matter if the compiler might generate the same code with or without 
indentation, it's still totally unacceptable.

Having preprocessor conditionals that mix things up is not an excuse, and 
it might be an argument for not doing the conditional that way (ie maybe 
just make sure that when NUMA is not on, nid/next_nid will always be 
different, and in a way that the compiler can perhaps see statically that 
they are different - so that you can have the conditional there even with 
NUMA off, but the compiler will just fold it away?).

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