mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: "Ben Hutchings" <bhutchings@solarflare.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, "Ingo Molnar" <mingo@elte.hu>
Subject: Re: [PATCH] cputopology: Add default CPU topology information [3rd try]
Date: Sun, 1 Jun 2008 01:11:02 +0200	[thread overview]
Message-ID: <19f34abd0805311611x29b6a4aas572ee180ef7eb2c7@mail.gmail.com> (raw)
In-Reply-To: <20080531214429.GQ1743@solarflare.com>

On Sat, May 31, 2008 at 11:44 PM, Ben Hutchings
<bhutchings@solarflare.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

  reply	other threads:[~2008-05-31 23:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-31 21:44 Ben Hutchings
2008-05-31 23:11 ` Vegard Nossum [this message]
2008-05-31 23:44   ` Ben Hutchings
2008-06-03 20:02 ` Andrew Morton
2008-06-04 15:07   ` Ben Hutchings

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=19f34abd0805311611x29b6a4aas572ee180ef7eb2c7@mail.gmail.com \
    --to=vegard.nossum@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhutchings@solarflare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®