lkml.org 
[lkml]   [2009]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 3/7] PCI: reserve bus range for SR-IOV device
On Mon, Mar 09, 2009 at 11:09:02AM -0700, Randy Dunlap wrote:
> >> static inline __pure u16 virtfn_bdf(struct pci_dev *dev, int id)
> >> {
> >> return (dev->bus->number << 8) + dev->devfn + dev->sriov->offset +
> >> dev->sriov->stride * id;
> >> }
> >>
> >> #define VIRT_BUS(dev, id) (virtfn_bdf(dev, id) >> 8)
> >> #define VIRT_DEVFN(dev, id) (virtfn_bdf(dev, id) & 0xff)
> >>
> >> We rely on GCC to do CSE and not actually invoke virtfn_bdf more than
> >> once.
> >
> > Yes, that's a good idea. Will replace that function with macros.
>
> That's the opposite of most changes lately. I.e., functions (with
> typechecking) are preferred.

There's every bit as much typechecking with the approach I outlined as
there was with the original.

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."


\
 
 \ /
  Last update: 2009-03-09 19:13    [W:0.075 / U:1.980 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site