Re: [PATCH] 2.6.1-rc2 - MPT Fusion driver 3.00.00 update

From: Matthew Wilcox
Date: Wed Jan 07 2004 - 12:13:04 EST


On Tue, Jan 06, 2004 at 05:08:47PM -0700, Eric Moore wrote:
> +static struct pci_device_id mptbase_pci_table[] = {
> + {
> + .vendor = PCI_VENDOR_ID_LSI_LOGIC,
> + .device = PCI_DEVICE_ID_LSI_FC909,
> + .subvendor = PCI_ANY_ID,
> + .subdevice = PCI_ANY_ID,
> + .class = PCI_CLASS_SERIAL_FIBER << 8,
> + .class_mask = 0xFFFF00,
> + .driver_data = DEVT_INDEX_MPT
> + },

This is all pretty verbose. The normal style for device drivers is:

static struct pci_device_id mptbase_pci_table[] = {
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1035,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVT_INDEX_MPT },
{ }
}

Although since you don't make any use of DEVT_INDEX_MPT, you can drop the last
three entries and simply write:

{ PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1035,
PCI_ANY_ID, PCI_ANY_ID },

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
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/