Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9baa3c34 authored by Benoit Taine's avatar Benoit Taine Committed by Bjorn Helgaas
Browse files

PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use

We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines.  This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/

):

// <smpl>

@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@

- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;

// </smpl>

[bhelgaas: add semantic patch]
Signed-off-by: default avatarBenoit Taine <benoit.taine@lip6.fr>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent c8d6637d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -945,7 +945,7 @@ static struct intel_uncore_type *snbep_pci_uncores[] = {
	NULL,
};

static DEFINE_PCI_DEVICE_TABLE(snbep_uncore_pci_ids) = {
static const struct pci_device_id snbep_uncore_pci_ids[] = {
	{ /* Home Agent */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_UNC_HA),
		.driver_data = UNCORE_PCI_DEV_DATA(SNBEP_PCI_UNCORE_HA, 0),
@@ -1510,7 +1510,7 @@ static struct intel_uncore_type *ivt_pci_uncores[] = {
	NULL,
};

static DEFINE_PCI_DEVICE_TABLE(ivt_uncore_pci_ids) = {
static const struct pci_device_id ivt_uncore_pci_ids[] = {
	{ /* Home Agent 0 */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xe30),
		.driver_data = UNCORE_PCI_DEV_DATA(IVT_PCI_UNCORE_HA, 0),
@@ -1985,7 +1985,7 @@ static struct intel_uncore_type *snb_pci_uncores[] = {
	NULL,
};

static DEFINE_PCI_DEVICE_TABLE(snb_uncore_pci_ids) = {
static const struct pci_device_id snb_uncore_pci_ids[] = {
	{ /* IMC */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SNB_IMC),
		.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
@@ -1993,7 +1993,7 @@ static DEFINE_PCI_DEVICE_TABLE(snb_uncore_pci_ids) = {
	{ /* end: all zeroes */ },
};

static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = {
static const struct pci_device_id ivb_uncore_pci_ids[] = {
	{ /* IMC */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_IMC),
		.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
@@ -2001,7 +2001,7 @@ static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = {
	{ /* end: all zeroes */ },
};

static DEFINE_PCI_DEVICE_TABLE(hsw_uncore_pci_ids) = {
static const struct pci_device_id hsw_uncore_pci_ids[] = {
	{ /* IMC */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HSW_IMC),
		.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static int iosf_mbi_probe(struct pci_dev *pdev,
	return 0;
}

static DEFINE_PCI_DEVICE_TABLE(iosf_mbi_pci_ids) = {
static const struct pci_device_id iosf_mbi_pci_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_BAYTRAIL) },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_QUARK_X1000) },
	{ 0, },
+1 −1
Original line number Diff line number Diff line
@@ -4632,7 +4632,7 @@ static void mtip_pci_shutdown(struct pci_dev *pdev)
}

/* Table of device ids supported by this driver. */
static DEFINE_PCI_DEVICE_TABLE(mtip_pci_tbl) = {
static const struct pci_device_id mtip_pci_tbl[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320H_DEVICE_ID) },
	{ PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320M_DEVICE_ID) },
	{ PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320S_DEVICE_ID) },
+1 −1
Original line number Diff line number Diff line
@@ -1137,7 +1137,7 @@ static const struct pci_error_handlers rsxx_err_handler = {
	.slot_reset     = rsxx_slot_reset,
};

static DEFINE_PCI_DEVICE_TABLE(rsxx_pci_ids) = {
static const struct pci_device_id rsxx_pci_ids[] = {
	{PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_FS70_FLASH)},
	{PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_FS80_FLASH)},
	{0,},
+1 −1
Original line number Diff line number Diff line
@@ -4766,7 +4766,7 @@ static const struct block_device_operations skd_blockdev_ops = {
 *****************************************************************************
 */

static DEFINE_PCI_DEVICE_TABLE(skd_pci_tbl) = {
static const struct pci_device_id skd_pci_tbl[] = {
	{ PCI_VENDOR_ID_STEC, PCI_DEVICE_ID_S1120,
	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
	{ 0 }                     /* terminate list */
Loading