Replace DEFINE_PCI_DEVICE_TABLE macro use
Subsystems (35)
cover Replace DEFINE_PCI_DEVICE_TABLE macro use
We should prefer const 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>
I have 103 patches ready, and will only send a few for you to judge if it is useful enough, and to prevent from spamming too much.
Thanks.
PATCH 1/25 bna: Replace 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.
---
Tested by compilation without errors.
drivers/net/ethernet/brocade/bna/bnad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/brocade/bna/bnad.c +1 -1
@@ -3836,7 +3836,7 @@ bnad_pci_remove(struct pci_dev *pdev)free_netdev (netdev); } -static DEFINE_PCI_DEVICE_TABLE (bnad_pci_id_table) = { +static const struct pci_device_id bnad_pci_id_table[] = { {PCI_DEVICE (PCI_VENDOR_ID_BROCADE ,PCI_DEVICE_ID_BROCADE_CT ),
PATCH 2/25 BusLogic: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/scsi/BusLogic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/BusLogic.c +1 -1
@@ -3893,7 +3893,7 @@ __setup("BusLogic=", blogic_setup);PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { } };*/ -static DEFINE_PCI_DEVICE_TABLE (blogic_pci_tbl) = { +static const struct pci_device_id blogic_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_BUSLOGIC ,PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER )}, {PCI_DEVICE (PCI_VENDOR_ID_BUSLOGIC ,PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC )}, {PCI_DEVICE (PCI_VENDOR_ID_BUSLOGIC ,PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT )},
Re: [PATCH 2/25] BusLogic: Replace DEFINE_PCI_DEVICE_TABLE macro use
Quoted 17 lines · Benoit Taine
We should prefer
struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Signed-off-by Benoit Taine <[email protected]>---
Tested by compilation without errors.drivers/scsi/BusLogic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/BusLogic.c +0
-0
drivers/scsi/BusLogic.c __setup("BusLogic=", blogic_setup); · line 3899
Quoted 8 lines
drivers/scsi/BusLogic.c +1
-1@@ -3893,7 +3893,7 @@ __setup("BusLogic=", blogic_setup);PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { } };*/ -static DEFINE_PCI_DEVICE_TABLE (blogic_pci_tbl) = { +static const struct pci_device_id blogic_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_BUSLOGIC ,PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER )}, {PCI_DEVICE (PCI_VENDOR_ID_BUSLOGIC ,PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC )}, {PCI_DEVICE (PCI_VENDOR_ID_BUSLOGIC ,PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT )},
PATCH 3/25 iwlegacy: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Not tested.
drivers/net/wireless/iwlegacy/3945.c | 2 +- drivers/net/wireless/iwlegacy/4965-mac.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlegacy/3945.c +1 -1
@@ -2728,7 +2728,7 @@ static struct il_cfg il3945_abg_cfg = { }, }; -DEFINE_PCI_DEVICE_TABLE (il3945_hw_card_ids) = { +const struct pci_device_id il3945_hw_card_ids[] = { {IL_PCI_DEVICE (0x4222 ,0x1005 , il3945_bg_cfg)}, {IL_PCI_DEVICE (0x4222 ,0x1034 , il3945_bg_cfg)}, {IL_PCI_DEVICE (0x4222 ,0x1044 , il3945_bg_cfg)},
drivers/net/wireless/iwlegacy/4965-mac.c +1 -1
@@ -6800,7 +6800,7 @@ il4965_txq_set_sched(struct il_priv *il, u32 mask)*****************************************************************************/ /* Hardware specific file defines the PCI IDs table for that hardware module */ -static DEFINE_PCI_DEVICE_TABLE (il4965_hw_card_ids) = { +static const struct pci_device_id il4965_hw_card_ids[] = { {IL_PCI_DEVICE (0x4229 ,PCI_ANY_ID , il4965_cfg)}, {IL_PCI_DEVICE (0x4230 ,PCI_ANY_ID , il4965_cfg)}, {0 }
PATCH 4/25 net: pasemi: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Not tested.
drivers/net/ethernet/pasemi/pasemi_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/pasemi/pasemi_mac.c +1 -1
@@ -1871,7 +1871,7 @@ static void pasemi_mac_remove(struct pci_dev *pdev)free_netdev (netdev); } -static DEFINE_PCI_DEVICE_TABLE (pasemi_mac_pci_tbl) = { +static const struct pci_device_id pasemi_mac_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_PASEMI ,0xa005 ) }, {PCI_DEVICE (PCI_VENDOR_ID_PASEMI ,0xa006 ) }, { },
PATCH 5/25 net/ethernet/sgi/ioc3-eth: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Not tested.
drivers/net/ethernet/sgi/ioc3-eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sgi/ioc3-eth.c +1 -1
@@ -1384,7 +1384,7 @@ static void ioc3_remove_one(struct pci_dev *pdev)*/ } -static DEFINE_PCI_DEVICE_TABLE (ioc3_pci_tbl) = { +static const struct pci_device_id ioc3_pci_tbl[] = { {PCI_VENDOR_ID_SGI ,PCI_DEVICE_ID_SGI_IOC3 ,PCI_ANY_ID ,PCI_ANY_ID }, {0 } };
PATCH 6/25 x86: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/platform/x86/intel_ips.c | 2 +- drivers/platform/x86/intel_scu_ipc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/intel_ips.c +1 -1
@@ -1478,7 +1478,7 @@ ips_link_to_i915_driver(void) }EXPORT_SYMBOL_GPL (ips_link_to_i915_driver); -static DEFINE_PCI_DEVICE_TABLE (ips_id_table) = { +static const struct pci_device_id ips_id_table[] = { {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_THERMAL_SENSOR ), }, {0 , }
drivers/platform/x86/intel_scu_ipc.c +1 -1
@@ -640,7 +640,7 @@ static void ipc_remove(struct pci_dev *pdev)intel_scu_devices_destroy (); } -static DEFINE_PCI_DEVICE_TABLE (pci_ids) = { +static const struct pci_device_id pci_ids[] = { {PCI_VDEVICE (INTEL ,PCI_DEVICE_ID_LINCROFT ), (kernel_ulong_t)&intel_scu_ipc_lincroft_pdata,
PATCH 7/25 rt2x00: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500pci.c | 2 +- drivers/net/wireless/rt2x00/rt2800pci.c | 2 +- drivers/net/wireless/rt2x00/rt61pci.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
@@ -1821,7 +1821,7 @@ static const struct rt2x00_ops rt2400pci_ops = {/* * RT2400pci module information. */ -static DEFINE_PCI_DEVICE_TABLE (rt2400pci_device_table) = { +static const struct pci_device_id rt2400pci_device_table[] = { {PCI_DEVICE (0x1814 ,0x0101 ) }, {0 , } };
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
@@ -2120,7 +2120,7 @@ static const struct rt2x00_ops rt2500pci_ops = {/* * RT2500pci module information. */ -static DEFINE_PCI_DEVICE_TABLE (rt2500pci_device_table) = { +static const struct pci_device_id rt2500pci_device_table[] = { {PCI_DEVICE (0x1814 ,0x0201 ) }, {0 , } };
drivers/net/wireless/rt2x00/rt2800pci.c +1 -1
@@ -400,7 +400,7 @@ static const struct rt2x00_ops rt2800pci_ops = {/* * RT2800pci module information. */ -static DEFINE_PCI_DEVICE_TABLE (rt2800pci_device_table) = { +static const struct pci_device_id rt2800pci_device_table[] = { {PCI_DEVICE (0x1814 ,0x0601 ) }, {PCI_DEVICE (0x1814 ,0x0681 ) }, {PCI_DEVICE (0x1814 ,0x0701 ) },
drivers/net/wireless/rt2x00/rt61pci.c +1 -1
@@ -3075,7 +3075,7 @@ static const struct rt2x00_ops rt61pci_ops = {/* * RT61pci module information. */ -static DEFINE_PCI_DEVICE_TABLE (rt61pci_device_table) = { +static const struct pci_device_id rt61pci_device_table[] = {/* RT2561s */ {PCI_DEVICE (0x1814 ,0x0301 ) },/* RT2561 v2 */
PATCH 8/25 dscc4: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/wan/dscc4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wan/dscc4.c +1 -1
@@ -2039,7 +2039,7 @@ static int __init dscc4_setup(char *str)__setup ("dscc4.setup=" , dscc4_setup);#endif -static DEFINE_PCI_DEVICE_TABLE (dscc4_pci_tbl) = { +static const struct pci_device_id dscc4_pci_tbl[] = { {PCI_VENDOR_ID_SIEMENS ,PCI_DEVICE_ID_SIEMENS_DSCC4 ,PCI_ANY_ID ,PCI_ANY_ID , }, {0 ,}
PATCH 9/25 net: neterion: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/neterion/s2io.c | 2 +- drivers/net/ethernet/neterion/vxge/vxge-main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/neterion/s2io.c +1 -1
@@ -471,7 +471,7 @@ module_param_array(rts_frm_len, uint, NULL, 0);* S2IO device table. * This table lists all the devices that this driver supports. */ -static DEFINE_PCI_DEVICE_TABLE (s2io_tbl) = { +static const struct pci_device_id s2io_tbl[] = { {PCI_VENDOR_ID_S2IO ,PCI_DEVICE_ID_S2IO_WIN ,PCI_ANY_ID ,PCI_ANY_ID }, {PCI_VENDOR_ID_S2IO ,PCI_DEVICE_ID_S2IO_UNI ,
drivers/net/ethernet/neterion/vxge/vxge-main.c +1 -1
@@ -63,7 +63,7 @@ MODULE_LICENSE("Dual BSD/GPL");MODULE_DESCRIPTION ("Neterion's X3100 Series 10GbE PCIe I/O" "Virtualized Server Adapter" ); -static DEFINE_PCI_DEVICE_TABLE (vxge_id_table) = { +static const struct pci_device_id vxge_id_table[] = { {PCI_VENDOR_ID_S2IO ,PCI_DEVICE_ID_TITAN_WIN ,PCI_ANY_ID ,PCI_ANY_ID }, {PCI_VENDOR_ID_S2IO ,PCI_DEVICE_ID_TITAN_UNI ,PCI_ANY_ID ,
PATCH 10/25 netxen: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +1 -1
@@ -99,7 +99,7 @@ static int netxen_nic_set_mac(struct net_device *netdev, void *p); {PCI_DEVICE(PCI_VENDOR_ID_NETXEN, (device)), \ .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = ~0} -static DEFINE_PCI_DEVICE_TABLE (netxen_pci_tbl) = { +static const struct pci_device_id netxen_pci_tbl[] = {ENTRY (PCI_DEVICE_ID_NX2031_10GXSR ),ENTRY (PCI_DEVICE_ID_NX2031_10GCX4 ),ENTRY (PCI_DEVICE_ID_NX2031_4GCU ),
PATCH 11/25 pcnet32: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/amd/pcnet32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amd/pcnet32.c +1 -1
@@ -61,7 +61,7 @@ static const char *const version =/* * PCI device identifiers for "new style" Linux PCI Device Drivers */ -static DEFINE_PCI_DEVICE_TABLE (pcnet32_pci_tbl) = { +static const struct pci_device_id pcnet32_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_LANCE_HOME ), }, {PCI_DEVICE (PCI_VENDOR_ID_AMD ,PCI_DEVICE_ID_AMD_LANCE ), },
PATCH 12/25 r8169: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -291,7 +291,7 @@ enum cfg_version {RTL_CFG_2 }; -static DEFINE_PCI_DEVICE_TABLE (rtl8169_pci_tbl) = { +static const struct pci_device_id rtl8169_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,0x8129 ),0 ,0 ,RTL_CFG_0 }, {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,0x8136 ),0 ,0 ,RTL_CFG_2 }, {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,0x8167 ),0 ,0 ,RTL_CFG_0 },
PATCH 13/25 IB/mlx5: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/infiniband/hw/mlx5/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/main.c +1 -1
@@ -1515,7 +1515,7 @@ static void remove_one(struct pci_dev *pdev)ib_dealloc_device (&dev->ib_dev); } -static DEFINE_PCI_DEVICE_TABLE (mlx5_ib_pci_table) = { +static const struct pci_device_id mlx5_ib_pci_table[] = { {PCI_VDEVICE (MELLANOX ,4113 ) },/* MT4113 Connect-IB */ {0 , } };
PATCH 14/25 adm8211: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/wireless/adm8211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/adm8211.c +1 -1
@@ -41,7 +41,7 @@ static unsigned int rx_ring_size __read_mostly = 16;module_param (tx_ring_size, uint,0 );module_param (rx_ring_size, uint,0 ); -static DEFINE_PCI_DEVICE_TABLE (adm8211_pci_id_table) = { +static const struct pci_device_id adm8211_pci_id_table[] = {/* ADMtek ADM8211 */ {PCI_DEVICE (0x10B7 ,0x6000 ) },/* 3Com 3CRSHPW796 */ {PCI_DEVICE (0x1200 ,0x8201 ) },/* ? */
PATCH 15/25 qlcnic: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -1
@@ -108,7 +108,7 @@ static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter) {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, (device)), \ .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = ~0} -static DEFINE_PCI_DEVICE_TABLE (qlcnic_pci_tbl) = { +static const struct pci_device_id qlcnic_pci_tbl[] = {ENTRY (PCI_DEVICE_ID_QLOGIC_QLE824X ),ENTRY (PCI_DEVICE_ID_QLOGIC_QLE834X ),ENTRY (PCI_DEVICE_ID_QLOGIC_VF_QLE834X ),
PATCH 16/25 be2net: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/emulex/benet/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_main.c +1 -1
@@ -39,7 +39,7 @@ static ushort rx_frag_size = 2048;module_param (rx_frag_size, ushort,S_IRUGO );MODULE_PARM_DESC (rx_frag_size,"Size of a fragment that holds rcvd data." ); -static DEFINE_PCI_DEVICE_TABLE (be_dev_ids) = { +static const struct pci_device_id be_dev_ids[] = { {PCI_DEVICE (BE_VENDOR_ID ,BE_DEVICE_ID1 ) }, {PCI_DEVICE (BE_VENDOR_ID ,BE_DEVICE_ID2 ) }, {PCI_DEVICE (BE_VENDOR_ID ,OC_DEVICE_ID1 ) },
PATCH 17/25 block: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/block/rsxx/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rsxx/core.c +1 -1
@@ -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 ,},
PATCH 18/25 smsc9420: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/smsc/smsc9420.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/smsc/smsc9420.c +1 -1
@@ -83,7 +83,7 @@ struct smsc9420_pdata {int last_carrier; }; -static DEFINE_PCI_DEVICE_TABLE (smsc9420_id_table) = { +static const struct pci_device_id smsc9420_id_table[] = { {PCI_VENDOR_ID_9420 ,PCI_DEVICE_ID_9420 ,PCI_ANY_ID ,PCI_ANY_ID , }, {0 , } };
PATCH 19/25 irda: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Not tested.
drivers/net/irda/donauboe.c | 2 +- drivers/net/irda/via-ircc.c | 2 +- drivers/net/irda/vlsi_ir.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/irda/donauboe.c +1 -1
@@ -184,7 +184,7 @@#define CONFIG0H_DMA_ON_NORX CONFIG0H_DMA_OFF| OBOE_CONFIG0H_ENDMAC#define CONFIG0H_DMA_ON CONFIG0H_DMA_ON_NORX | OBOE_CONFIG0H_ENRX -static DEFINE_PCI_DEVICE_TABLE (toshoboe_pci_tbl) = { +static const struct pci_device_id toshoboe_pci_tbl[] = { {PCI_VENDOR_ID_TOSHIBA ,PCI_DEVICE_ID_FIR701 ,PCI_ANY_ID ,PCI_ANY_ID , }, {PCI_VENDOR_ID_TOSHIBA ,PCI_DEVICE_ID_FIRD01 ,PCI_ANY_ID ,PCI_ANY_ID , }, { }/* Terminating entry */
drivers/net/irda/via-ircc.c +1 -1
@@ -115,7 +115,7 @@ static void iodelay(int udelay) } } -static DEFINE_PCI_DEVICE_TABLE (via_pci_tbl) = { +static const struct pci_device_id via_pci_tbl[] = { {PCI_VENDOR_ID_VIA ,0x8231 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {PCI_VENDOR_ID_VIA ,0x3109 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,1 }, {PCI_VENDOR_ID_VIA ,0x3074 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,2 },
drivers/net/irda/vlsi_ir.c +1 -1
@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL");static /* const */ char drivername[] =DRIVER_NAME ; -static DEFINE_PCI_DEVICE_TABLE (vlsi_irda_table) = { +static const struct pci_device_id vlsi_irda_table[] = { { .class =PCI_CLASS_WIRELESS_IRDA <<8 , .class_mask =PCI_CLASS_SUBCLASS_MASK <<8 ,
PATCH 20/25 via-rhine: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/via/via-rhine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/via/via-rhine.c +1 -1
@@ -273,7 +273,7 @@ enum rhine_quirks {/* Beware of PCI posted writes */ #define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0) -static DEFINE_PCI_DEVICE_TABLE (rhine_pci_tbl) = { +static const struct pci_device_id rhine_pci_tbl[] = { {0x1106 ,0x3043 ,PCI_ANY_ID ,PCI_ANY_ID , },/* VT86C100A */ {0x1106 ,0x3065 ,PCI_ANY_ID ,PCI_ANY_ID , },/* VT6102 */ {0x1106 ,0x3106 ,PCI_ANY_ID ,PCI_ANY_ID , },/* 6105{,L,LOM} */
PATCH 21/25 hostap: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/wireless/hostap/hostap_pci.c | 2 +- drivers/net/wireless/hostap/hostap_plx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/hostap/hostap_pci.c +1 -1
@@ -39,7 +39,7 @@ struct hostap_pci_priv {/* FIX: do we need mb/wmb/rmb with memory operations? */ -static DEFINE_PCI_DEVICE_TABLE (prism2_pci_id_table) = { +static const struct pci_device_id prism2_pci_id_table[] = {/* Intersil Prism3 ISL3872 11Mb/s WLAN Controller */ {0x1260 ,0x3872 ,PCI_ANY_ID ,PCI_ANY_ID },/* Intersil Prism2.5 ISL3874 11Mb/s WLAN Controller */
drivers/net/wireless/hostap/hostap_plx.c +1 -1
@@ -60,7 +60,7 @@ struct hostap_plx_priv {#define PLXDEV (vendor,dev,str) { vendor, dev, PCI_ANY_ID, PCI_ANY_ID } -static DEFINE_PCI_DEVICE_TABLE (prism2_plx_id_table) = { +static const struct pci_device_id prism2_plx_id_table[] = {PLXDEV (0x10b7 ,0x7770 ,"3Com AirConnect PCI 777A" ),PLXDEV (0x111a ,0x1023 ,"Siemens SpeedStream SS1023" ),PLXDEV (0x126c ,0x8030 ,"Nortel emobility" ),
PATCH 22/25 drivers/net: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/arcnet/com20020-pci.c | 2 +- drivers/net/ethernet/chelsio/cxgb/subr.c | 2 +- drivers/net/ethernet/dlink/dl2k.h | 2 +- drivers/net/ethernet/fealnx.c | 2 +- drivers/net/ethernet/mellanox/mlx4/main.c | 2 +- drivers/net/ethernet/micrel/ksz884x.c | 2 +- drivers/net/ethernet/natsemi/ns83820.c | 2 +- drivers/net/ethernet/nvidia/forcedeth.c | 2 +- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 2 +- drivers/net/ethernet/packetengines/hamachi.c | 2 +- drivers/net/ethernet/packetengines/yellowfin.c | 2 +- drivers/net/ethernet/realtek/8139cp.c | 2 +- drivers/net/ethernet/realtek/8139too.c | 2 +- drivers/net/ethernet/silan/sc92031.c | 2 +- drivers/net/ethernet/smsc/epic100.c | 2 +- drivers/net/ethernet/sun/cassini.c | 2 +- drivers/net/ethernet/sun/niu.c | 2 +- drivers/net/ethernet/sun/sungem.c | 2 +- drivers/net/ethernet/sun/sunhme.c | 2 +- drivers/net/ethernet/toshiba/tc35815.c | 2 +- drivers/net/fddi/skfp/skfddi.c | 2 +- drivers/net/wan/lmc/lmc_main.c | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-)
drivers/net/arcnet/com20020-pci.c +1 -1
@@ -144,7 +144,7 @@ static void com20020pci_remove(struct pci_dev *pdev)free_netdev (dev); } -static DEFINE_PCI_DEVICE_TABLE (com20020pci_id_table) = { +static const struct pci_device_id com20020pci_id_table[] = { {0x1571 ,0xa001 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {0x1571 ,0xa002 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {0x1571 ,0xa003 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 },
drivers/net/ethernet/chelsio/cxgb/subr.c +1 -1
@@ -522,7 +522,7 @@ static const struct board_info t1_board[] = { }; -DEFINE_PCI_DEVICE_TABLE (t1_pci_tbl) = { +const struct pci_device_id t1_pci_tbl[] = {CH_DEVICE (8 ,0 ,CH_BRD_T110_1CU ),CH_DEVICE (8 ,1 ,CH_BRD_T110_1CU ),CH_DEVICE (7 ,0 ,CH_BRD_N110_1F ),
drivers/net/ethernet/dlink/dl2k.h +1 -1
@@ -408,7 +408,7 @@ struct netdev_private {driver_data Data private to the driver. */ -static DEFINE_PCI_DEVICE_TABLE (rio_pci_tbl) = { +static const struct pci_device_id rio_pci_tbl[] = { {0x1186 ,0x4000 ,PCI_ANY_ID ,PCI_ANY_ID , }, {0x13f0 ,0x1021 ,PCI_ANY_ID ,PCI_ANY_ID , }, { }
drivers/net/ethernet/fealnx.c +1 -1
@@ -1936,7 +1936,7 @@ static int netdev_close(struct net_device *dev)return 0 ; } -static DEFINE_PCI_DEVICE_TABLE (fealnx_pci_tbl) = { +static const struct pci_device_id fealnx_pci_tbl[] = { {0x1516 ,0x0800 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {0x1516 ,0x0803 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,1 }, {0x1516 ,0x0891 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,2 },
drivers/net/ethernet/mellanox/mlx4/main.c +1 -1
@@ -2705,7 +2705,7 @@ int mlx4_restart_one(struct pci_dev *pdev)return __mlx4_init_one (pdev, pci_dev_data); } -static DEFINE_PCI_DEVICE_TABLE (mlx4_pci_table) = { +static const struct pci_device_id mlx4_pci_table[] = {/* MT25408 "Hermon" SDR */ {PCI_VDEVICE (MELLANOX ,0x6340 ),MLX4_PCI_DEV_FORCE_SENSE_PORT },/* MT25408 "Hermon" DDR */
drivers/net/ethernet/micrel/ksz884x.c +1 -1
@@ -7221,7 +7221,7 @@ static int pcidev_suspend(struct pci_dev *pdev, pm_message_t state)static char pcidev_name[] ="ksz884xp" ; -static DEFINE_PCI_DEVICE_TABLE (pcidev_table) = { +static const struct pci_device_id pcidev_table[] = { {PCI_VENDOR_ID_MICREL_KS ,0x8841 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {PCI_VENDOR_ID_MICREL_KS ,0x8842 ,
drivers/net/ethernet/natsemi/ns83820.c +1 -1
@@ -2260,7 +2260,7 @@ static void ns83820_remove_one(struct pci_dev *pci_dev)free_netdev (ndev); } -static DEFINE_PCI_DEVICE_TABLE (ns83820_pci_tbl) = { +static const struct pci_device_id ns83820_pci_tbl[] = { {0x100b ,0x0022 ,PCI_ANY_ID ,PCI_ANY_ID ,0 , .driver_data =0 , }, {0 , }, };
drivers/net/ethernet/nvidia/forcedeth.c +1 -1
@@ -6185,7 +6185,7 @@ static void nv_shutdown(struct pci_dev *pdev)#define nv_shutdown NULL#endif /* CONFIG_PM */ -static DEFINE_PCI_DEVICE_TABLE (pci_tbl) = { +static const struct pci_device_id pci_tbl[] = { {/* nForce Ethernet Controller */ PCI_DEVICE (0x10DE ,0x01C3 ), .driver_data =DEV_NEED_TIMERIRQ |DEV_NEED_LINKTIMER ,
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +1 -1
@@ -2743,7 +2743,7 @@ static struct pch_gbe_privdata pch_gbe_minnow_privdata = { .platform_init = pch_gbe_minnow_platform_init, }; -static DEFINE_PCI_DEVICE_TABLE (pch_gbe_pcidev_id) = { +static const struct pci_device_id pch_gbe_pcidev_id[] = { {.vendor =PCI_VENDOR_ID_INTEL , .device =PCI_DEVICE_ID_INTEL_IOH1_GBE , .subvendor =PCI_VENDOR_ID_CIRCUITCO ,
drivers/net/ethernet/packetengines/hamachi.c +1 -1
@@ -1911,7 +1911,7 @@ static void hamachi_remove_one(struct pci_dev *pdev) } } -static DEFINE_PCI_DEVICE_TABLE (hamachi_pci_tbl) = { +static const struct pci_device_id hamachi_pci_tbl[] = { {0x1318 ,0x0911 ,PCI_ANY_ID ,PCI_ANY_ID , }, {0 , } };
drivers/net/ethernet/packetengines/yellowfin.c +1 -1
@@ -236,7 +236,7 @@ static const struct pci_id_info pci_id_tbl[] = { { } }; -static DEFINE_PCI_DEVICE_TABLE (yellowfin_pci_tbl) = { +static const struct pci_device_id yellowfin_pci_tbl[] = { {0x1000 ,0x0702 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {0x1000 ,0x0701 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,1 }, { }
drivers/net/ethernet/realtek/8139cp.c +1 -1
@@ -382,7 +382,7 @@ static int cp_get_eeprom(struct net_device *dev,static int cp_set_eeprom (struct net_device *dev,struct ethtool_eeprom *eeprom,u8 *data); -static DEFINE_PCI_DEVICE_TABLE (cp_pci_tbl) = { +static const struct pci_device_id cp_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_REALTEK ,PCI_DEVICE_ID_REALTEK_8139 ), }, {PCI_DEVICE (PCI_VENDOR_ID_TTTECH ,PCI_DEVICE_ID_TTTECH_MC322 ), }, { },
drivers/net/ethernet/realtek/8139too.c +1 -1
@@ -234,7 +234,7 @@ static const struct { }; -static DEFINE_PCI_DEVICE_TABLE (rtl8139_pci_tbl) = { +static const struct pci_device_id rtl8139_pci_tbl[] = { {0x10ec ,0x8139 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,RTL8139 }, {0x10ec ,0x8138 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,RTL8139 }, {0x1113 ,0x1211 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,RTL8139 },
drivers/net/ethernet/silan/sc92031.c +1 -1
@@ -1561,7 +1561,7 @@ out:return 0 ; } -static DEFINE_PCI_DEVICE_TABLE (sc92031_pci_device_id_table) = { +static const struct pci_device_id sc92031_pci_device_id_table[] = { {PCI_DEVICE (PCI_VENDOR_ID_SILAN ,0x2031 ) }, {PCI_DEVICE (PCI_VENDOR_ID_SILAN ,0x8139 ) }, {PCI_DEVICE (0x1088 ,0x2031 ) },
drivers/net/ethernet/smsc/epic100.c +1 -1
@@ -173,7 +173,7 @@ static const struct epic_chip_info pci_id_tbl[] = { }; -static DEFINE_PCI_DEVICE_TABLE (epic_pci_tbl) = { +static const struct pci_device_id epic_pci_tbl[] = { {0x10B8 ,0x0005 ,0x1092 ,0x0AB4 ,0 ,0 ,SMSC_83C170_0 }, {0x10B8 ,0x0005 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,SMSC_83C170 }, {0x10B8 ,0x0006 ,PCI_ANY_ID ,PCI_ANY_ID ,
drivers/net/ethernet/sun/cassini.c +1 -1
@@ -229,7 +229,7 @@ static u16 link_modes[] = {CAS_BMCR_SPEED1000 |BMCR_FULLDPLX /* 5 : 1000bt full duplex */ }; -static DEFINE_PCI_DEVICE_TABLE (cas_pci_tbl) = { +static const struct pci_device_id cas_pci_tbl[] = { {PCI_VENDOR_ID_SUN ,PCI_DEVICE_ID_SUN_CASSINI ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0UL }, {PCI_VENDOR_ID_NS ,PCI_DEVICE_ID_NS_SATURN ,
drivers/net/ethernet/sun/niu.c +1 -1
@@ -59,7 +59,7 @@ static void writeq(u64 val, void __iomem *reg) }#endif -static DEFINE_PCI_DEVICE_TABLE (niu_pci_tbl) = { +static const struct pci_device_id niu_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_SUN ,0xabcd )}, {} };
drivers/net/ethernet/sun/sungem.c +1 -1
@@ -85,7 +85,7 @@ MODULE_LICENSE("GPL");#define GEM_MODULE_NAME "gem" -static DEFINE_PCI_DEVICE_TABLE (gem_pci_tbl) = { +static const struct pci_device_id gem_pci_tbl[] = { {PCI_VENDOR_ID_SUN ,PCI_DEVICE_ID_SUN_GEM ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0UL },
drivers/net/ethernet/sun/sunhme.c +1 -1
@@ -3172,7 +3172,7 @@ static void happy_meal_pci_remove(struct pci_dev *pdev)free_netdev (net_dev); } -static DEFINE_PCI_DEVICE_TABLE (happymeal_pci_ids) = { +static const struct pci_device_id happymeal_pci_ids[] = { {PCI_DEVICE (PCI_VENDOR_ID_SUN ,PCI_DEVICE_ID_SUN_HAPPYMEAL ) }, { }/* Terminating entry */ };
drivers/net/ethernet/toshiba/tc35815.c +1 -1
@@ -65,7 +65,7 @@ static const struct { { "TOSHIBA TC35815/TX4939" }, }; -static DEFINE_PCI_DEVICE_TABLE (tc35815_pci_tbl) = { +static const struct pci_device_id tc35815_pci_tbl[] = { {PCI_DEVICE (PCI_VENDOR_ID_TOSHIBA_2 ,PCI_DEVICE_ID_TOSHIBA_TC35815CF ), .driver_data =TC35815CF }, {PCI_DEVICE (PCI_VENDOR_ID_TOSHIBA_2 ,PCI_DEVICE_ID_TOSHIBA_TC35815_NWU ), .driver_data =TC35815_NWU }, {PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC35815_TX4939), .driver_data = TC35815_TX4939 },
drivers/net/fddi/skfp/skfddi.c +1 -1
@@ -149,7 +149,7 @@ extern void mac_drv_rx_mode(struct s_smc *smc, int mode);extern void mac_drv_clear_rx_queue (struct s_smc *smc);extern void enable_tx_irq (struct s_smc *smc,u_short queue); -static DEFINE_PCI_DEVICE_TABLE (skfddi_pci_tbl) = { +static const struct pci_device_id skfddi_pci_tbl[] = { {PCI_VENDOR_ID_SK ,PCI_DEVICE_ID_SK_FP ,PCI_ANY_ID ,PCI_ANY_ID , }, { }/* Terminating entry */ };
drivers/net/wan/lmc/lmc_main.c +1 -1
@@ -76,7 +76,7 @@static int LMC_PKT_BUF_SZ =1542 ; -static DEFINE_PCI_DEVICE_TABLE (lmc_pci_tbl) = { +static const struct pci_device_id lmc_pci_tbl[] = { {PCI_VENDOR_ID_DEC ,PCI_DEVICE_ID_DEC_TULIP_FAST ,PCI_VENDOR_ID_LMC ,PCI_ANY_ID }, {PCI_VENDOR_ID_DEC ,PCI_DEVICE_ID_DEC_TULIP_FAST ,
PATCH 23/25 virtio: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/virtio/virtio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_pci.c +1 -1
@@ -91,7 +91,7 @@ struct virtio_pci_vq_info };/* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */ -static DEFINE_PCI_DEVICE_TABLE (virtio_pci_id_table) = { +static const struct pci_device_id virtio_pci_id_table[] = { {PCI_DEVICE (0x1af4 ,PCI_ANY_ID ) }, {0 } };
Rusty Russell
AppliedRe: [PATCH 23/25] virtio: Replace DEFINE_PCI_DEVICE_TABLE macro use
Quoted 4 lines · Benoit Taine
We should prefer
struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Signed-off-by Benoit Taine <[email protected]>
Thanks, applied.
Cheers,
Rusty.
PATCH 23/25 virtio: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/virtio/virtio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_pci.c +1 -1
@@ -91,7 +91,7 @@ struct virtio_pci_vq_info };/* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */ -static DEFINE_PCI_DEVICE_TABLE (virtio_pci_id_table) = { +static const struct pci_device_id virtio_pci_id_table[] = { {PCI_DEVICE (0x1af4 ,PCI_ANY_ID ) }, {0 } };
PATCH 24/25 starfire: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/net/ethernet/adaptec/starfire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/adaptec/starfire.c +1 -1
@@ -285,7 +285,7 @@ enum chipset { CH_6915 = 0, }; -static DEFINE_PCI_DEVICE_TABLE (starfire_pci_tbl) = { +static const struct pci_device_id starfire_pci_tbl[] = { {PCI_VDEVICE (ADAPTEC ,0x6915 ),CH_6915 }, {0 , } };
PATCH 25/25 ipack: Replace DEFINE_PCI_DEVICE_TABLE macro use
In reply to Benoit TaineWe should prefer struct pci_device_id over DEFINE_PCI_DEVICE_TABLE to meet kernel coding style guidelines. This issue was reported by checkpatch.
---
Tested by compilation without errors.
drivers/ipack/carriers/tpci200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ipack/carriers/tpci200.c +1 -1
@@ -618,7 +618,7 @@ static void tpci200_pci_remove(struct pci_dev *dev)__tpci200_pci_remove (tpci200); } -static DEFINE_PCI_DEVICE_TABLE (tpci200_idtable) = { +static const struct pci_device_id tpci200_idtable[] = { {TPCI200_VENDOR_ID ,TPCI200_DEVICE_ID ,TPCI200_SUBVENDOR_ID ,TPCI200_SUBDEVICE_ID }, {0 , },
Re: [PATCH 25/25] ipack: Replace DEFINE_PCI_DEVICE_TABLE macro use
Quoted 18 lines · Benoit Taine
We should prefer
struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Signed-off-by Benoit Taine <[email protected]>---
Tested by compilation without errors.drivers/ipack/carriers/tpci200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ipack/carriers/tpci200.c +0
-0
drivers/ipack/carriers/tpci200.c static void tpci200_pci_remove(struct pci_dev *dev) · line 624
Quoted 8 lines
drivers/ipack/carriers/tpci200.c +1
-1@@ -618,7 +618,7 @@ static void tpci200_pci_remove(struct pci_dev *dev)__tpci200_pci_remove (tpci200); } -static DEFINE_PCI_DEVICE_TABLE (tpci200_idtable) = { +static const struct pci_device_id tpci200_idtable[] = { {TPCI200_VENDOR_ID ,TPCI200_DEVICE_ID ,TPCI200_SUBVENDOR_ID ,TPCI200_SUBDEVICE_ID }, {0 , },
Greg, Would you mind picking this patch through your char-misc tree?
Thanks,
Sam
Greg Kroah-Hartman
maintainerRe: [PATCH 25/25] ipack: Replace DEFINE_PCI_DEVICE_TABLE macro use
Quoted 30 lines · Samuel Iglesias Gonsálvez
Quoted 18 lines · Benoit Taine
We should prefer
struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Signed-off-by Benoit Taine <[email protected]>---
Tested by compilation without errors.drivers/ipack/carriers/tpci200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ipack/carriers/tpci200.c +0
-0drivers/ipack/carriers/tpci200.c static void tpci200_pci_remove(struct pci_dev *dev) · line 624
Quoted 8 lines
drivers/ipack/carriers/tpci200.c +1
-1@@ -618,7 +618,7 @@ static void tpci200_pci_remove(struct pci_dev *dev)__tpci200_pci_remove (tpci200); } -static DEFINE_PCI_DEVICE_TABLE (tpci200_idtable) = { +static const struct pci_device_id tpci200_idtable[] = { {TPCI200_VENDOR_ID ,TPCI200_DEVICE_ID ,TPCI200_SUBVENDOR_ID ,TPCI200_SUBDEVICE_ID }, {0 , },
Quoted 1 line
Greg, Would you mind picking this patch through your char-misc tree?
Will do, thanks.
greg k-h
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
John
Signature · 7 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready. _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing, so why should PCI be "special" in this regard anymore?
thanks,
greg k-h
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
James Bottomley
maintainerQuoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the DEFINE_PCI_DEVICE_TABLE macro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?
I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
James
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]
Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
As there is no need for the __init macro mess anymore, there's no real need for the DEFINE_PCI_DEVICE_TABLE macro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.
Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725
And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223
So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From Documentation/PCI/pci.txt:
The ID table is an array of struct pci_device_id entries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided.
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
thanks,
greg k-h
James Bottomley
maintainerQuoted 33 lines · Greg KH
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
Quoted 4 lines
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
I've a weak preference for consistency, but not at the expense of hundreds of patches churning the kernel to remove an innocuous macro. Churn costs time and effort.
Quoted 31 lines
As there is no need for the
__initmacro mess anymore, there's no real need for theDEFINE_PCI_DEVICE_TABLEmacro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From
Documentation/PCI/pci.txt:The ID table is an array of struct
pci_device_identries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macroDEFINE_PCI_DEVICE_TABLEshould be avoided.
Quoted 5 lines
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
In this case, I don't think it does that much ... a cut and paste either way (from a macro or non-macro based driver) yields correct code. Since there's no bug here and no apparent way to misuse the macro, why bother?
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...)
James
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Bjorn Helgaas
maintainer[+cc Jingoo]
Quoted 80 lines · James Bottomley
Quoted 33 lines · Greg KH
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254Quoted 4 lines
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
I've a weak preference for consistency, but not at the expense of hundreds of patches churning the kernel to remove an innocuous macro. Churn costs time and effort.
Quoted 31 lines
As there is no need for the
__initmacro mess anymore, there's no real need for theDEFINE_PCI_DEVICE_TABLEmacro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From
Documentation/PCI/pci.txt:The ID table is an array of struct
pci_device_identries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macroDEFINE_PCI_DEVICE_TABLEshould be avoided.Quoted 5 lines
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
Quoted 8 lines
In this case, I don't think it does that much ... a cut and paste either way (from a macro or non-macro based driver) yields correct code. Since there's no bug here and no apparent way to misuse the macro, why bother?
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Ji?? has experience doing this, but the former might be useful so the decider feels the pain ...)
I don't feel strongly either way, so I guess I'm OK with this, and in the spirit of feeling the pain, I'm willing to handle it. Jingoo proposed similar patches, so it might be nice to give him some credit.
Benoit, how about if you wait until about half-way through the merge window after v3.16 releases, generate an up-to-date single patch, and post that? Then we can try to get it in before v3.17-rc1 to minimize merge hassles.
Bjorn
Quoted 8 lines · Bjorn Helgaas
[+cc Jingoo]
On Fri, Jul 18, 2014 at 12:50 PM, James Bottomley
Quoted 4 lines
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...)
Quoted 8 lines
I don't feel strongly either way, so I guess I'm OK with this, and in the spirit of feeling the pain, I'm willing to handle it. Jingoo proposed similar patches, so it might be nice to give him some credit.
Benoit, how about if you wait until about half-way through the merge window after v3.16 releases, generate an up-to-date single patch, and post that? Then we can try to get it in before v3.17-rc1 to minimize merge hassles.
Sure, I will do this.
Signature · 3 lines
Benoît Taine Master cycle intern Regal Team. LIP6
Quoted 8 lines · Bjorn Helgaas
[+cc Jingoo]
On Fri, Jul 18, 2014 at 12:50 PM, James Bottomley
Quoted 4 lines
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...)
Quoted 8 lines
I don't feel strongly either way, so I guess I'm OK with this, and in the spirit of feeling the pain, I'm willing to handle it. Jingoo proposed similar patches, so it might be nice to give him some credit.
Benoit, how about if you wait until about half-way through the merge window after v3.16 releases, generate an up-to-date single patch, and post that? Then we can try to get it in before v3.17-rc1 to minimize merge hassles.
Sure, I will do this.
Signature · 8 lines
Benoît Taine Master cycle intern Regal Team. LIP6 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 8 lines · Bjorn Helgaas
[+cc Jingoo]
On Fri, Jul 18, 2014 at 12:50 PM, James Bottomley
Quoted 4 lines
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...)
Quoted 8 lines
I don't feel strongly either way, so I guess I'm OK with this, and in the spirit of feeling the pain, I'm willing to handle it. Jingoo proposed similar patches, so it might be nice to give him some credit.
Benoit, how about if you wait until about half-way through the merge window after v3.16 releases, generate an up-to-date single patch, and post that? Then we can try to get it in before v3.17-rc1 to minimize merge hassles.
Sure, I will do this.
Signature · 7 lines
Benoît Taine Master cycle intern Regal Team. LIP6 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Bjorn Helgaas
maintainer[+cc Jingoo]
Quoted 80 lines · James Bottomley
Quoted 33 lines · Greg KH
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254Quoted 4 lines
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
I've a weak preference for consistency, but not at the expense of hundreds of patches churning the kernel to remove an innocuous macro. Churn costs time and effort.
Quoted 31 lines
As there is no need for the
__initmacro mess anymore, there's no real need for theDEFINE_PCI_DEVICE_TABLEmacro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From
Documentation/PCI/pci.txt:The ID table is an array of struct
pci_device_identries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macroDEFINE_PCI_DEVICE_TABLEshould be avoided.Quoted 5 lines
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
Quoted 8 lines
In this case, I don't think it does that much ... a cut and paste either way (from a macro or non-macro based driver) yields correct code. Since there's no bug here and no apparent way to misuse the macro, why bother?
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...)
I don't feel strongly either way, so I guess I'm OK with this, and in the spirit of feeling the pain, I'm willing to handle it. Jingoo proposed similar patches, so it might be nice to give him some credit.
Benoit, how about if you wait until about half-way through the merge window after v3.16 releases, generate an up-to-date single patch, and post that? Then we can try to get it in before v3.17-rc1 to minimize merge hassles.
Bjorn
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
James Bottomley
maintainerQuoted 33 lines · Greg KH
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
Quoted 4 lines
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
I've a weak preference for consistency, but not at the expense of hundreds of patches churning the kernel to remove an innocuous macro. Churn costs time and effort.
Quoted 31 lines
As there is no need for the
__initmacro mess anymore, there's no real need for theDEFINE_PCI_DEVICE_TABLEmacro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From
Documentation/PCI/pci.txt:The ID table is an array of struct
pci_device_identries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macroDEFINE_PCI_DEVICE_TABLEshould be avoided.
Quoted 5 lines
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
In this case, I don't think it does that much ... a cut and paste either way (from a macro or non-macro based driver) yields correct code. Since there's no bug here and no apparent way to misuse the macro, why bother?
Anyway, it's PCI code ... let the PCI maintainer decide. However, if he does want this do it as one big bang patch via either the PCI or Trivial tree (latter because Jiří has experience doing this, but the former might be useful so the decider feels the pain ...)
James
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 7 lines
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
did you check for non-const ones? just to see if we have any of the broken case in the tree :-)
as for consistency, pci_dev vs usb_device :-P
Dave.
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 10 lines · Dave Airlie
Quoted 7 lines
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254did you check for non-const ones? just to see if we have any of the broken case in the tree :-)
I didn't :)
Quoted 1 line
as for consistency,
pci_devvsusb_device:-P
Read farther down the email...
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 10 lines · Dave Airlie
Quoted 7 lines
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254did you check for non-const ones? just to see if we have any of the broken case in the tree :-)
I didn't :)
Quoted 1 line
as for consistency,
pci_devvsusb_device:-P
Read farther down the email...
Quoted 7 lines
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
did you check for non-const ones? just to see if we have any of the broken case in the tree :-)
as for consistency, pci_dev vs usb_device :-P
Dave.
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]
Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
As there is no need for the __init macro mess anymore, there's no real need for the DEFINE_PCI_DEVICE_TABLE macro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.
Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725
And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223
So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From Documentation/PCI/pci.txt:
The ID table is an array of struct pci_device_id entries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided.
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
thanks,
greg k-h
Quoted 18 lines · James Bottomley
Quoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]
Quoted 6 lines
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the
DEFINE_PCI_DEVICE_TABLEmacro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.
We have almost 1000 more uses of the non-macro version than the "macro" version in the kernel today:
$ git grep -w DEFINE_PCI_DEVICE_TABLE | wc -l 262 $ git grep "const struct pci_device_id" | wc -l 1254
My big complaint is that we need to be consistant, either pick one or the other and stick to it. As the macro is the least used, it's easiest to fix up, and it also is more consistant with all other kernel subsystems which do not have such a macro.
As there is no need for the __init macro mess anymore, there's no real need for the DEFINE_PCI_DEVICE_TABLE macro either. I think checkpatch will catch the use of non-const users for the id table already today, it catches lots of other uses like this already.
Quoted 6 lines
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
Not really "dwarf", USB is close with over 700 such structures:
$ git grep "const struct usb_device_id" | wc -l 725
And i2c is almost just as big as PCI:
$ git grep "const struct i2c_device_id" | wc -l 1223
So again, this macro is not consistent with the majority of PCI drivers, nor with any other type of "device id" declaration in the kernel, which is why I feel it should be removed.
And finally, the PCI documentation itself says to not use this macro, so this isn't a "new" thing. From Documentation/PCI/pci.txt:
The ID table is an array of struct pci_device_id entries ending with an all-zero entry. Definitions with static const are generally preferred. Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided.
That wording went into the file last December, when we last talked about this and everyone in that discussion agreed to remove the macro for the above reasons.
Consistency matters.
thanks,
greg k-h
James Bottomley
maintainerQuoted 11 lines · Greg KH
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing
OK, so this is the macro:
#define DEFINE_PCI_DEVICE_TABLE(_table) \ const struct pci_device_id _table[]
Could you explain what's so horrible?
The reason it's useful today is that people forget the const (and sometimes the [] making it a true table instead of a pointer). If you use the DEFINE_PCI_DEVICE_TABLE macro, the compile breaks if you use it wrongly (good) and you automatically get the correct annotations.
Quoted 2 lines
, so why should PCI be "special" in this regard
anymore?
I think the PCI usage dwarfs most other bus types now, so you could turn the question around. However, I don't think majority voting is a good guide to best practise; lets debate the merits for their own sake.
James
Joe Perches
maintainerQuoted 5 lines · Greg KH
Quoted 4 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
Quoted 7 lines
Quoted 3 lines
scripts/checkpatch.pl | 4 ++--Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing, so why should PCI be "special" in this regard anymore?
I think it doesn't matter much.
The PCI_DEVICE and PCI_VDEVICE macro uses are somewhat similar and are frequently used with PCI_DEVICE_TABLE, so there's some commonality there.
The checkpatch message could be made --strict/CHK instead of WARN so most people would never see it.
Of course it could be removed altogether too. I don't care.
---
(suggested patch is for -next)
1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
@@ -3018,8 +3018,8 @@ sub process { # check for uses of DEFINE_PCI_DEVICE_TABLE if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { - if (WARN("DEFINE_PCI_DEVICE_TABLE", - "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && + if (CHK("DEFINE_PCI_DEVICE_TABLE", + "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && $fix) { $fixed[$fixlinenr] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /; }
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Joe Perches
maintainerQuoted 5 lines · Greg KH
Quoted 4 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
Quoted 7 lines
Quoted 3 lines
scripts/checkpatch.pl | 4 ++--Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing, so why should PCI be "special" in this regard anymore?
I think it doesn't matter much.
The PCI_DEVICE and PCI_VDEVICE macro uses are somewhat similar and are frequently used with PCI_DEVICE_TABLE, so there's some commonality there.
The checkpatch message could be made --strict/CHK instead of WARN so most people would never see it.
Of course it could be removed altogether too. I don't care.
---
(suggested patch is for -next)
1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
@@ -3018,8 +3018,8 @@ sub process { # check for uses of DEFINE_PCI_DEVICE_TABLE if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { - if (WARN("DEFINE_PCI_DEVICE_TABLE", - "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && + if (CHK("DEFINE_PCI_DEVICE_TABLE", + "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && $fix) { $fixed[$fixlinenr] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /; }
Joe Perches
maintainerQuoted 5 lines · Greg KH
Quoted 4 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
Quoted 7 lines
Quoted 3 lines
scripts/checkpatch.pl | 4 ++--Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing, so why should PCI be "special" in this regard anymore?
I think it doesn't matter much.
The PCI_DEVICE and PCI_VDEVICE macro uses are somewhat similar and are frequently used with PCI_DEVICE_TABLE, so there's some commonality there.
The checkpatch message could be made --strict/CHK instead of WARN so most people would never see it.
Of course it could be removed altogether too. I don't care.
---
(suggested patch is for -next)
1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
@@ -3018,8 +3018,8 @@ sub process { # check for uses of DEFINE_PCI_DEVICE_TABLE if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { - if (WARN("DEFINE_PCI_DEVICE_TABLE", - "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && + if (CHK("DEFINE_PCI_DEVICE_TABLE", + "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && $fix) { $fixed[$fixlinenr] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /; }
Quoted 7 lines · John W. Linville
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
The macro is horrid, no other bus has this type of thing just to save a few characters in typing, so why should PCI be "special" in this regard anymore?
thanks,
greg k-h
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
James Bottomley
maintainerQuoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
What kernel coding style? checkpatch isn't the arbiter of style, if that's the only problem.
The DEFINE_PCI macro was a well reasoned addition when it was added in 2008. The problem was most people were getting the definition wrong. When we converted away from CONFIG_HOTPLUG, having this DEFINE_ meant that only one place needed changing instead of hundreds for PCI tables.
The reason people were getting the PCI table wrong was mostly the init section specifiers which are now gone, but it has enough underlying utility (mostly constification) that I don't think we'd want to churn the kernel hugely to make a change to struct pci_table and then have to start detecting and fixing misuses.
James
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 19 lines · James Bottomley
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.What kernel coding style? checkpatch isn't the arbiter of style, if that's the only problem.
The
DEFINE_PCImacro was a well reasoned addition when it was added in 2008. The problem was most people were getting the definition wrong. When we converted away fromCONFIG_HOTPLUG, having thisDEFINE_meant that only one place needed changing instead of hundreds for PCI tables.The reason people were getting the PCI table wrong was mostly the init section specifiers which are now gone, but it has enough underlying utility (mostly constification) that I don't think we'd want to churn the kernel hugely to make a change to struct
pci_tableand then have to start detecting and fixing misuses.
Quoted 7 lines
James
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
I would rather fix the misuses of the macro, than remove it. Could we possibly make checkpatch smart enough to tell when the macro is misused?
Thanks,
Jake
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 19 lines · James Bottomley
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.What kernel coding style? checkpatch isn't the arbiter of style, if that's the only problem.
The
DEFINE_PCImacro was a well reasoned addition when it was added in 2008. The problem was most people were getting the definition wrong. When we converted away fromCONFIG_HOTPLUG, having thisDEFINE_meant that only one place needed changing instead of hundreds for PCI tables.The reason people were getting the PCI table wrong was mostly the init section specifiers which are now gone, but it has enough underlying utility (mostly constification) that I don't think we'd want to churn the kernel hugely to make a change to struct
pci_tableand then have to start detecting and fixing misuses.
Quoted 7 lines
James
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
I would rather fix the misuses of the macro, than remove it. Could we possibly make checkpatch smart enough to tell when the macro is misused?
Thanks,
Jake
Quoted 19 lines · James Bottomley
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.What kernel coding style? checkpatch isn't the arbiter of style, if that's the only problem.
The
DEFINE_PCImacro was a well reasoned addition when it was added in 2008. The problem was most people were getting the definition wrong. When we converted away fromCONFIG_HOTPLUG, having thisDEFINE_meant that only one place needed changing instead of hundreds for PCI tables.The reason people were getting the PCI table wrong was mostly the init section specifiers which are now gone, but it has enough underlying utility (mostly constification) that I don't think we'd want to churn the kernel hugely to make a change to struct
pci_tableand then have to start detecting and fixing misuses.
Quoted 7 lines
James
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
I would rather fix the misuses of the macro, than remove it. Could we possibly make checkpatch smart enough to tell when the macro is misused?
Thanks,
Jake
James Bottomley
maintainerQuoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
What kernel coding style? checkpatch isn't the arbiter of style, if that's the only problem.
The DEFINE_PCI macro was a well reasoned addition when it was added in 2008. The problem was most people were getting the definition wrong. When we converted away from CONFIG_HOTPLUG, having this DEFINE_ meant that only one place needed changing instead of hundreds for PCI tables.
The reason people were getting the PCI table wrong was mostly the init section specifiers which are now gone, but it has enough underlying utility (mostly constification) that I don't think we'd want to churn the kernel hugely to make a change to struct pci_table and then have to start detecting and fixing misuses.
James
Quoted 3 lines · Benoit Taine
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto meet kernel coding style guidelines. This issue was reported by checkpatch.
Honestly, I prefer the macro -- it stands-out more. Maybe the style guidelines and/or checkpatch should change instead?
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
David Miller
maintainerFrom: Benoit Taine <[email protected]>
Date: Fri, 18 Jul 2014 17:26:47 +0200
Quoted 15 lines
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto 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 nameDEFINE_PCI_DEVICE_TABLE;
initializer z;
@@
Quoted 8 lines
-
DEFINE_PCI_DEVICE_TABLE(i)
+ const structpci_device_idi[]
= z;// </smpl>
I have 103 patches ready, and will only send a few for you to judge if it is useful enough, and to prevent from spamming too much.
I'm fine with this wrt. the networking changes, but I don't think this should be merged via my tree.
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
David Miller
maintainerFrom: Benoit Taine <[email protected]>
Date: Fri, 18 Jul 2014 17:26:47 +0200
Quoted 15 lines
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto 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 nameDEFINE_PCI_DEVICE_TABLE;
initializer z;
@@
Quoted 8 lines
-
DEFINE_PCI_DEVICE_TABLE(i)
+ const structpci_device_idi[]
= z;// </smpl>
I have 103 patches ready, and will only send a few for you to judge if it is useful enough, and to prevent from spamming too much.
I'm fine with this wrt. the networking changes, but I don't think this should be merged via my tree.
David Miller
maintainerFrom: Benoit Taine <[email protected]>
Date: Fri, 18 Jul 2014 17:26:47 +0200
Quoted 15 lines
We should prefer
const struct pci_device_idoverDEFINE_PCI_DEVICE_TABLEto 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 nameDEFINE_PCI_DEVICE_TABLE;
initializer z;
@@
Quoted 8 lines
-
DEFINE_PCI_DEVICE_TABLE(i)
+ const structpci_device_idi[]
= z;// </smpl>
I have 103 patches ready, and will only send a few for you to judge if it is useful enough, and to prevent from spamming too much.
I'm fine with this wrt. the networking changes, but I don't think this should be merged via my tree.