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]
Message-ID: <19f34abd0805311611x29b6a4aas572ee180ef7eb2c7@mail.gmail.com>
Date:	Sun, 1 Jun 2008 01:11:02 +0200
From:	"Vegard Nossum" <vegard.nossum@...il.com>
To:	"Ben Hutchings" <bhutchings@...arflare.com>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, "Ingo Molnar" <mingo@...e.hu>
Subject: Re: [PATCH] cputopology: Add default CPU topology information [3rd try]

On Sat, May 31, 2008 at 11:44 PM, Ben Hutchings
<bhutchings@...arflare.com> wrote:
> Define the macros topology_{physical_package,core}_id() and
> topology_{thread,core}_siblings() in <asm-generic/topology.h> if they are not
> already defined.
>
> Move inclusion of <asm-generic/topology.h> after definitions of these
> macros in <asm-powerpc/topology.h> and <asm-x86/topology.h>.

Hi again :)

As I said in my previous e-mail, having #includes in the middle of
headers is nasty. This kind of dependency is really subtle and makes
later modification much harder. (Actually, it hurts readability as
well.)

The standard way to do this seems to be:

asm/topology.h should define ARCH_HAS_* macros if it wishes to
override the defaults
linux/topology.h should #include asm/topology.h at the top of the file
linux/topology.h should define the generic functions/macros only if
the ARCH_HAS_* macros are undefined

Other files wishing to use these definitions should then include
linux/topology.h.

Or is that unfeasible in this case?


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036
--
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