From: "Glauber Costa" <glommer@gmail.com>
To: "Robert Richter" <robert.richter@amd.com>
Cc: "Arjan van de Ven" <arjan@infradead.org>,
"Yinghai Lu" <yhlu.kernel@gmail.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@elte.hu>,
LKML <linux-kernel@vger.kernel.org>,
"Andi Kleen" <andi@firstfloor.org>
Subject: Re: [PATCH 2/2] x86: Move PCI IO ECS code to x86/pci
Date: Fri, 13 Jun 2008 15:26:53 -0300 [thread overview]
Message-ID: <5d6222a80806131126w593ca7c1t1a5b527329af0fe4@mail.gmail.com> (raw)
In-Reply-To: <20080613181627.GH10019@erda.amd.com>
On Fri, Jun 13, 2008 at 3:16 PM, Robert Richter <robert.richter@amd.com> wrote:
> On 13.06.08 14:02:46, Glauber Costa wrote:
>> > diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
>> > index 5c2799c..15f505d 100644
>> > --- a/arch/x86/pci/amd_bus.c
>> > +++ b/arch/x86/pci/amd_bus.c
>> > @@ -1,5 +1,9 @@
>> > #include <linux/init.h>
>> > #include <linux/pci.h>
>> > +#include "pci.h"
>> > +
>> > +#ifdef CONFIG_X86_64
>>
>> Please, don't do that. We are in an ongoing effort to cleanup the
>> remaining ifdefs in x86 code, and adding more of them would just make
>> it harder.
>> If you really need it, move the common part to a separate file (avoid
>> the _32 and _64 naming), and have it compiled conditionally on your
>> architecture.
>
> Ok, so what about shared code? Keep all this in separate files:
> amd_bus.c, (amd_bus_32.c), amd_bus_64.c, (amd_bus.h)?
>
> Is the strategy to avoid #ifdefs and instead use the flags in
> Makefiles? My intention was to coalesce the files. Maybe I was wrong
> here.
The strategy is to coalesce the files if they do the same thing. If
you can find an implementation that is shared
between both, it is surely the most preferable option among them all.
Even if it takes more time.
For some of them, this is obviously not intrinsically possible. That's
the case for example, of the .S files that touch deep details of the
architectures. (ok, ok, _some_ of that code might well be shared in
the future). Another example, is the page headers. Part of it
were kept in page_32.h and page_64.h.
If not, ifdefs in the .h file are probably okay, if they can be used
to avoid them in .c code.
But of course, those things are not carved in stone. If you really
think that ifdef should go there, feel free to do it, with a good
justification.
--
Glauber Costa.
"Free as in Freedom"
http://glommer.net
"The less confident you are, the more serious you have to act."
next prev parent reply other threads:[~2008-06-13 18:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-23 12:46 Enable mmconf access to PCI ECS for all AMD fam10h systems Robert Richter
2008-05-23 17:57 ` Yinghai Lu
2008-05-23 18:18 ` Arjan van de Ven
2008-05-23 19:06 ` Yinghai Lu
2008-05-26 18:06 ` Robert Richter
2007-09-03 8:17 ` [PATCH] x86: Add PCI extended config space access for AMD Barcelona Robert Richter
2008-05-28 19:02 ` Arjan van de Ven
2008-06-02 14:19 ` Robert Richter
2008-06-03 2:35 ` Arjan van de Ven
2008-06-03 7:25 ` Robert Richter
2008-06-12 18:19 ` [PATCH 1/2] x86/pci: Renaming k8-bus_64.c to amd_bus.c Robert Richter
2008-06-12 19:51 ` Yinghai Lu
2008-06-13 12:47 ` Robert Richter
2008-06-18 7:46 ` Ingo Molnar
2008-06-19 16:02 ` Robert Richter
2008-06-12 18:19 ` [PATCH 2/2] x86: Move PCI IO ECS code to x86/pci Robert Richter
2008-06-12 19:50 ` Yinghai Lu
2008-06-13 16:19 ` Robert Richter
2008-06-13 17:02 ` Glauber Costa
2008-06-13 18:16 ` Robert Richter
2008-06-13 18:26 ` Glauber Costa [this message]
2008-06-18 7:51 ` Ingo Molnar
2008-06-18 7:47 ` Ingo Molnar
2008-06-02 9:09 ` [PATCH] x86: Add PCI extended config space access for AMD Barcelona Ingo Molnar
2008-06-02 13:56 ` Robert Richter
2008-06-02 20:31 ` Yinghai Lu
2008-06-03 7:35 ` Robert Richter
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=5d6222a80806131126w593ca7c1t1a5b527329af0fe4@mail.gmail.com \
--to=glommer@gmail.com \
--cc=andi@firstfloor.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=robert.richter@amd.com \
--cc=tglx@linutronix.de \
--cc=yhlu.kernel@gmail.com \
/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®