From: Andi Kleen <andi@firstfloor.org>
To: SL Baur <steve@xemacs.org>
Cc: Pavel Machek <pavel@ucw.cz>,
kernel list <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: gart: factor out common code
Date: Thu, 17 Apr 2008 08:29:51 +0200 [thread overview]
Message-ID: <4806EE5F.1040305@firstfloor.org> (raw)
In-Reply-To: <ed10ee420804161955o221539f9p5cbfcc9eaf4b375d@mail.gmail.com>
SL Baur wrote:
> On 4/16/08, Pavel Machek <pavel@ucw.cz> wrote:
>> On Tue 2008-04-15 16:25:29, SL Baur wrote:
>> > On 4/15/08, Pavel Machek <pavel@ucw.cz> wrote:
>
>> > Other reviewer comments:
>> > The casting between struct pci_dev * and u64 is kind of ugly,
>> > I presume the reason for the narrowing casts in the block of
>> > code you moved is documented somewhere.
>>
>>
>> Where am I doing that?
>
> The struct pci_dev */u64 casting is in init_k8_gatt. If Ingo is happy, then
> forget my comment. I don't have this kind of system to test the patch on, it
> was just that as I was looking it over, all the casts kind of made my head
> swim.
I think the casts make it more clear because the register is 32bit.
The only truly ugly bit is naming a variable "tmp".
> The narrowing cast is here:
> +static inline void enable_gart_translation(struct pci_dev *dev, u64 addr)
> +{
> + u32 tmp, ctl;
> +
> + /* address of the mappings table */
> + addr >>= 12;
> + tmp = (u32) addr<<4;
>
> Also, putting on my Andrew Morton cap, which I should have done before,
> that function is too big to be inlined so you should probably drop the explicit
> `inline' and let the compiler decide.
In a header static inline is needed, otherwise the compiler will warn
about an unused static if it's not used which is unfortunate because
not every includer wants to use all functions.
That said the function should probably not be in a header.
-Andi
next prev parent reply other threads:[~2008-04-17 6:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-15 10:43 gart: factor out common code Pavel Machek
2008-04-15 23:25 ` SL Baur
2008-04-16 8:14 ` Pavel Machek
2008-04-17 2:55 ` SL Baur
2008-04-17 6:29 ` Andi Kleen [this message]
2008-04-17 7:34 ` SL Baur
2008-04-16 13:08 ` Ingo Molnar
2008-04-16 22:50 ` Yinghai Lu
2008-04-16 22:56 ` Pavel Machek
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=4806EE5F.1040305@firstfloor.org \
--to=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pavel@ucw.cz \
--cc=steve@xemacs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.