lkml.org 
[lkml]   [2005]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] Janitorial cleanup of GET_INDEX macro in arch/i386/pci/fixup.c
On Mon, Jun 27, 2005 at 03:19:11PM -0700, Linus Torvalds wrote:
>
>
> On Mon, 27 Jun 2005, Neil Horman wrote:
> >
> > Patch to clean up the implementation of the GET_INDEX macro in the i386 pci
> > fixup code so that it uses the PCI_DEVFN macro, rather than re-implements it.
>
> This looks wrong:
>
> > -#define GET_INDEX(a, b) ((((a) - PCI_DEVICE_ID_INTEL_MCH_PA) << 3) + ((b) & 7))
> > +#define GET_INDEX(a, b) PCI_DEVFN((a - PCI_DEVICE_ID_INTEL_MCH_PA),b)
>
> that first argument looks like it has parentheses at the wrong place, it
> should be
>
> (a) - PCI_DEVICE_ID_INTEL_MCH_PA
>
> rather than
>
> (a - PCI_DEVICE_ID_INTEL_MCH_PA)
>
> methinks.
>
> Other than that... Greg?

I'd like to say yes, but I'll get an ack by the pci express people from
Intel first (PCI_DEVFN masks off bits that might be needed here, don't
really know...) Also, this is only used for an array index, not a
pci devfn memory access (look at how it is used in the code...)

I'll put it in my tree for now, and let it get testing, I would not
recommend it for yours just yet.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-28 00:36    [W:2.031 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site