RE: [PATCH]2.6.7 MSI-X Update

From: Nguyen, Tom L
Date: Wed Jun 23 2004 - 11:52:18 EST


On Tuesday, June 22, 2004 Roland Dreier wrote:
>I think this structure should be defined in a header in include/linux,
>probably <linux/pci.h>. We could create a new <linux/msi.h> include
>but I don't think it's worth it at this point. Also I don't see any
>reason to use bitfields or userspace types like __u32 (since no
>userspace code is going to use this include file). I would just
>declare the type as
>
>struct msix_entry {
> u16 vector;
> u16 entry;
>};
>
> > +int pci_enable_msix(struct pci_dev *dev, u32 *entries, int nvec)
>
>Since this function takes an array of struct msix_entry in its entries
>parameter, I think entries should be declared as struct msix_entry *
>rather than just u32 *. That is, I would write the prototype as
>
>int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries,
> int nvec);
>

Agree. Thanks for your suggestion of defining struct msix_entry in
<linux/pci.h>.

> > + j = (entries + i)->entry;
> > + (entries + i)->vector = vector;
>
>Finally, this is a nitpick, but this just looks odd to me. Why not
>write this as
>
> j = entries[i].entry;
> entries[i].vector = vector;
>

Agree. Thanks.

Thanks,
Long


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