LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* pci_device_id cleanups
@ 2008-02-20 12:53 Jonas Bonn
2008-02-20 12:53 ` [PATCH] Add PCI_DEVICE_TABLE macro Jonas Bonn
2008-02-20 13:17 ` pci_device_id cleanups Sam Ravnborg
0 siblings, 2 replies; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg
The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make much sense by itself... here is a set of patches that apply this macro, in turn moving a lot of this data into __devinitconst which is discardable in certain situations. Hopefully the benefit of this approach is a bit clearer now.
drivers/net/3c59x.c | 2 +-
drivers/net/amd8111e.c | 2 +-
drivers/net/arcnet/com20020-pci.c | 2 +-
drivers/net/defxx.c | 2 +-
drivers/net/hamachi.c | 2 +-
drivers/net/niu.c | 2 +-
drivers/net/pasemi_mac.c | 2 +-
drivers/net/sk98lin/skge.c | 2 +-
drivers/net/skfp/skfddi.c | 2 +-
drivers/net/starfire.c | 2 +-
drivers/net/sunhme.c | 2 +-
drivers/net/tlan.c | 2 +-
drivers/net/wan/dscc4.c | 2 +-
drivers/net/wan/lmc/lmc_main.c | 2 +-
include/linux/pci.h | 9 +++++++++
15 files changed, 23 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-20 12:53 pci_device_id cleanups Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst Jonas Bonn
2008-02-20 13:17 ` pci_device_id cleanups Sam Ravnborg
1 sibling, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
The definitions of struct pci_device_id arrays should generally follow
the same pattern across the entire kernel. This macro defines this
array as const and puts it into the __devinitconst section.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
include/linux/pci.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 87195b6..c7a91b1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -389,6 +389,15 @@ struct pci_driver {
#define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
/**
+ * PCI_DEVICE_TABLE - macro used to describe a pci device table
+ * @_table: device table name
+ *
+ * This macro is used to create a struct pci_device_id array (a device table)
+ * in a generic manner.
+ */
+#define PCI_DEVICE_TABLE(_table) const struct pci_device_id _table[] __devinitconst
+
+/**
* PCI_DEVICE - macro used to describe a specific pci device
* @vend: the 16 bit PCI Vendor ID
* @dev: the 16 bit PCI Device ID
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` [PATCH] Add PCI_DEVICE_TABLE macro Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/hamachi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index b53f6b6..d8056e9 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -1987,7 +1987,7 @@ static void __devexit hamachi_remove_one (struct pci_dev *pdev)
}
}
-static struct pci_device_id hamachi_pci_tbl[] = {
+static PCI_DEVICE_TABLE(hamachi_pci_tbl) = {
{ 0x1318, 0x0911, PCI_ANY_ID, PCI_ANY_ID, },
{ 0, }
};
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/amd8111e.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 85f7276..a4ad2fb 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -113,7 +113,7 @@ MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0
module_param_array(dynamic_ipg, bool, NULL, 0);
MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable");
-static struct pci_device_id amd8111e_pci_tbl[] = {
+static PCI_DEVICE_TABLE(amd8111e_pci_tbl) = {
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD8111E_7462,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/niu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index e98ce1e..ab8148a 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -62,7 +62,7 @@ static void writeq(u64 val, void __iomem *reg)
}
#endif
-static struct pci_device_id niu_pci_tbl[] = {
+static PCI_DEVICE_TABLE(niu_pci_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_SUN, 0xabcd)},
{}
};
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/tlan.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 3af5b92..bea59c6 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -253,7 +253,7 @@ static struct board {
{ "Compaq NetFlex-3/E", TLAN_ADAPTER_ACTIVITY_LED, 0x83 }, /* EISA card */
};
-static struct pci_device_id tlan_pci_tbl[] = {
+static PCI_DEVICE_TABLE(tlan_pci_tbl) = {
{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL10,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100,
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/starfire.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index c49214f..a67bac5 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -337,7 +337,7 @@ enum chipset {
CH_6915 = 0,
};
-static struct pci_device_id starfire_pci_tbl[] = {
+static PCI_DEVICE_TABLE(starfire_pci_tbl) = {
{ 0x9004, 0x6915, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_6915 },
{ 0, }
};
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/3c59x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 6f8e7d4..d2045d4 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -372,7 +372,7 @@ static struct vortex_chip_info {
};
-static struct pci_device_id vortex_pci_tbl[] = {
+static PCI_DEVICE_TABLE(vortex_pci_tbl) = {
{ 0x10B7, 0x5900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C590 },
{ 0x10B7, 0x5920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C592 },
{ 0x10B7, 0x5970, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C597 },
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/defxx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index ddc30c4..84a3ce5 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -3630,7 +3630,7 @@ static int __devinit dfx_pci_register(struct pci_dev *,
const struct pci_device_id *);
static void __devexit dfx_pci_unregister(struct pci_dev *);
-static struct pci_device_id dfx_pci_table[] = {
+static PCI_DEVICE_TABLE(dfx_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI) },
{ }
};
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/arcnet/com20020-pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index b8c0fa6..87ee0db 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -141,7 +141,7 @@ static void __devexit com20020pci_remove(struct pci_dev *pdev)
free_netdev(dev);
}
-static struct pci_device_id com20020pci_id_table[] = {
+static PCI_DEVICE_TABLE(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 },
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/sk98lin/skge.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 20890e4..eedcbeb 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -5166,7 +5166,7 @@ err_out:
#define skge_resume NULL
#endif
-static struct pci_device_id skge_pci_tbl[] = {
+static PCI_DEVICE_TABLE(skge_pci_tbl) = {
#ifdef SK98LIN_ALL_DEVICES
{ PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/wan/dscc4.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index c6f26e2..16d3a4c 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -2048,7 +2048,7 @@ static int __init dscc4_setup(char *str)
__setup("dscc4.setup=", dscc4_setup);
#endif
-static struct pci_device_id dscc4_pci_tbl[] = {
+static PCI_DEVICE_TABLE(dscc4_pci_tbl) = {
{ PCI_VENDOR_ID_SIEMENS, PCI_DEVICE_ID_SIEMENS_DSCC4,
PCI_ANY_ID, PCI_ANY_ID, },
{ 0,}
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/wan/lmc/lmc_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 6635ece..e85cfe7 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -82,7 +82,7 @@ static int lmc_first_load = 0;
static int LMC_PKT_BUF_SZ = 1542;
-static struct pci_device_id lmc_pci_tbl[] = {
+static PCI_DEVICE_TABLE(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,
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/sunhme.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index b4e7f30..beb0d27 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3247,7 +3247,7 @@ static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
dev_set_drvdata(&pdev->dev, NULL);
}
-static struct pci_device_id happymeal_pci_ids[] = {
+static PCI_DEVICE_TABLE(happymeal_pci_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
{ } /* Terminating entry */
};
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/pasemi_mac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 2e39e02..069fa7c 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1648,7 +1648,7 @@ static void __devexit pasemi_mac_remove(struct pci_dev *pdev)
free_netdev(netdev);
}
-static struct pci_device_id pasemi_mac_pci_tbl[] = {
+static PCI_DEVICE_TABLE(pasemi_mac_pci_tbl) = {
{ PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa005) },
{ PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa006) },
{ },
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst
2008-02-20 12:53 ` Jonas Bonn
@ 2008-02-20 12:53 ` Jonas Bonn
0 siblings, 0 replies; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 12:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: greg, Jonas Bonn
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
drivers/net/skfp/skfddi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 7cf9b9f..2a8386b 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -150,7 +150,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 struct pci_device_id skfddi_pci_tbl[] = {
+static PCI_DEVICE_TABLE(skfddi_pci_tbl) = {
{ PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_FP, PCI_ANY_ID, PCI_ANY_ID, },
{ } /* Terminating entry */
};
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: pci_device_id cleanups
2008-02-20 12:53 pci_device_id cleanups Jonas Bonn
2008-02-20 12:53 ` [PATCH] Add PCI_DEVICE_TABLE macro Jonas Bonn
@ 2008-02-20 13:17 ` Sam Ravnborg
2008-02-20 13:27 ` Jonas Bonn
1 sibling, 1 reply; 28+ messages in thread
From: Sam Ravnborg @ 2008-02-20 13:17 UTC (permalink / raw)
To: Jonas Bonn; +Cc: linux-kernel, netdev, greg
On Wed, Feb 20, 2008 at 01:53:36PM +0100, Jonas Bonn wrote:
>
> The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make
> much sense by itself... here is a set of patches that apply
> this macro, in turn moving a lot of this data into __devinitconst
> which is discardable in certain situations.
> Hopefully the benefit of this approach is a bit clearer now.
[shorter lines please..]
Can you please confirm that this does not break powerpc (64 bit)
as they have troubles with the constification..
Sam
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: pci_device_id cleanups
2008-02-20 13:17 ` pci_device_id cleanups Sam Ravnborg
@ 2008-02-20 13:27 ` Jonas Bonn
2008-02-20 13:55 ` PowerPC toolchain for x86 [Was: pci_device_id cleanups] Sam Ravnborg
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 13:27 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel, netdev, greg
Sam Ravnborg wrote:
> On Wed, Feb 20, 2008 at 01:53:36PM +0100, Jonas Bonn wrote:
>> The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make
>> much sense by itself... here is a set of patches that apply
>> this macro, in turn moving a lot of this data into __devinitconst
>> which is discardable in certain situations.
>> Hopefully the benefit of this approach is a bit clearer now.
> [shorter lines please..]
Sorry...
>
> Can you please confirm that this does not break powerpc (64 bit)
> as they have troubles with the constification..
I do not have access to any PowerPC machine... Olof Johansson built the
tree I posted earlier on PowerPC; there's nothing really new here except
the wrapping of the definition in a macro.
But of course, it would great if someone could confirm this...
>
> Sam
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* PowerPC toolchain for x86 [Was: pci_device_id cleanups]
2008-02-20 13:27 ` Jonas Bonn
@ 2008-02-20 13:55 ` Sam Ravnborg
2008-02-20 14:03 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Sam Ravnborg @ 2008-02-20 13:55 UTC (permalink / raw)
To: Jonas Bonn; +Cc: linux-kernel, netdev, greg, Andrew Morton
On Wed, Feb 20, 2008 at 02:27:19PM +0100, Jonas Bonn wrote:
> Sam Ravnborg wrote:
> >On Wed, Feb 20, 2008 at 01:53:36PM +0100, Jonas Bonn wrote:
> >>The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make
> >>much sense by itself... here is a set of patches that apply
> >>this macro, in turn moving a lot of this data into __devinitconst
> >>which is discardable in certain situations.
> >>Hopefully the benefit of this approach is a bit clearer now.
> >[shorter lines please..]
>
> Sorry...
>
> >
> >Can you please confirm that this does not break powerpc (64 bit)
> >as they have troubles with the constification..
>
> I do not have access to any PowerPC machine... Olof Johansson built the
> tree I posted earlier on PowerPC; there's nothing really new here except
> the wrapping of the definition in a macro.
And you added const and a specific section.
Exactly what could break on PowerPC.
To do the build break check is easy.
Google for "crosstool" and build your own powerpc toolchain.
Andrew has something precompiled somewhere but I lost the link.
Sam
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: PowerPC toolchain for x86 [Was: pci_device_id cleanups]
2008-02-20 13:55 ` PowerPC toolchain for x86 [Was: pci_device_id cleanups] Sam Ravnborg
@ 2008-02-20 14:03 ` Jonas Bonn
0 siblings, 0 replies; 28+ messages in thread
From: Jonas Bonn @ 2008-02-20 14:03 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel, netdev, greg, Andrew Morton
Sam Ravnborg wrote:
> On Wed, Feb 20, 2008 at 02:27:19PM +0100, Jonas Bonn wrote:
>> Sam Ravnborg wrote:
>>> On Wed, Feb 20, 2008 at 01:53:36PM +0100, Jonas Bonn wrote:
>>>> The PCI_DEVICE_TABLE patch I sent earlier doesn't necessarily make
>>>> much sense by itself... here is a set of patches that apply
>>>> this macro, in turn moving a lot of this data into __devinitconst
>>>> which is discardable in certain situations.
>>>> Hopefully the benefit of this approach is a bit clearer now.
>>> [shorter lines please..]
>> Sorry...
>>
>>> Can you please confirm that this does not break powerpc (64 bit)
>>> as they have troubles with the constification..
>> I do not have access to any PowerPC machine... Olof Johansson built the
>> tree I posted earlier on PowerPC; there's nothing really new here except
>> the wrapping of the definition in a macro.
> And you added const and a specific section.
No... once the macro is expanded the code is exactly the same as that
which built cleanly on powerpc previously (which Olof, built, I mean)...
nothing new here.
> Exactly what could break on PowerPC.
>
> To do the build break check is easy.
> Google for "crosstool" and build your own powerpc toolchain.
>
Thanks... I'll throw together a cross compiler and see what I can do.
/Jonas
> Andrew has something precompiled somewhere but I lost the link.
>
>
> Sam
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-20 16:11 ` Greg KH
@ 2008-02-20 17:05 ` Jeff Garzik
0 siblings, 0 replies; 28+ messages in thread
From: Jeff Garzik @ 2008-02-20 17:05 UTC (permalink / raw)
To: Greg KH; +Cc: Jonas Bonn, linux-kernel, olof, sam
Greg KH wrote:
> On Mon, Feb 18, 2008 at 08:34:42AM +0100, Jonas Bonn wrote:
>>> And again, what does this buy us?
>> Clarity and simplicity, I hope... there are a bunch of definitions
>> scattered about the kernel that omit the __devinitdata modifier despite the
>> documentation stating that it should always be there. The definition
>> really should have been const, which wasn't possible before but has become
>> so with the addition of the __devinitconst attribute.
>>
>> Furthermore, there are definitions that use "const" and __devinitdata,
>> which is explicitly wrong but the compiler doesn't catch section mismatches
>> if there's only one such one case in the module (which is often the case).
>>
>> Adding the __devinitconst modifier where there was nothing before buys us
>> memory. Adding the const modifier gives the compiler a chance to do its
>> thing. Changing __devinitdata to __devinitconst where it was wrong
>> actually fixes some compiler errors in older (mid-release) kernels that
>> were patched over by "removing" the section attribute altogether (which
>> wastes memory).
>>
>> Adding the macro (Olof's idea, not mine) makes it pretty difficult to get
>> this definition wrong... I'll do the rest of the cleanup, but I need to
>> know whether it's better to use a macro like this, or to open code the
>> definitions. I prefer the macro approach...
>>
>> Hope this makes some sense...
>
> Ok, yes it does, thanks for the explaination.
>
> Please, can you add this very good text to the changelog entry for the
> addition of the macro, and to the documentation somewhere? I'd be glad
> to take the patch if that was done.
I would suggest having a DECLARE_ prefix in there, like other subsystems
do...
Jeff
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-18 7:34 ` Jonas Bonn
@ 2008-02-20 16:11 ` Greg KH
2008-02-20 17:05 ` Jeff Garzik
0 siblings, 1 reply; 28+ messages in thread
From: Greg KH @ 2008-02-20 16:11 UTC (permalink / raw)
To: Jonas Bonn; +Cc: linux-kernel, olof, sam
On Mon, Feb 18, 2008 at 08:34:42AM +0100, Jonas Bonn wrote:
>> And again, what does this buy us?
>
> Clarity and simplicity, I hope... there are a bunch of definitions
> scattered about the kernel that omit the __devinitdata modifier despite the
> documentation stating that it should always be there. The definition
> really should have been const, which wasn't possible before but has become
> so with the addition of the __devinitconst attribute.
>
> Furthermore, there are definitions that use "const" and __devinitdata,
> which is explicitly wrong but the compiler doesn't catch section mismatches
> if there's only one such one case in the module (which is often the case).
>
> Adding the __devinitconst modifier where there was nothing before buys us
> memory. Adding the const modifier gives the compiler a chance to do its
> thing. Changing __devinitdata to __devinitconst where it was wrong
> actually fixes some compiler errors in older (mid-release) kernels that
> were patched over by "removing" the section attribute altogether (which
> wastes memory).
>
> Adding the macro (Olof's idea, not mine) makes it pretty difficult to get
> this definition wrong... I'll do the rest of the cleanup, but I need to
> know whether it's better to use a macro like this, or to open code the
> definitions. I prefer the macro approach...
>
> Hope this makes some sense...
Ok, yes it does, thanks for the explaination.
Please, can you add this very good text to the changelog entry for the
addition of the macro, and to the documentation somewhere? I'd be glad
to take the patch if that was done.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] Add PCI_DEVICE_TABLE macro
@ 2008-02-18 8:03 Jonas Bonn
0 siblings, 0 replies; 28+ messages in thread
From: Jonas Bonn @ 2008-02-18 8:03 UTC (permalink / raw)
To: linux-kernel, greg; +Cc: olof, randy.dunlap, Jonas Bonn
The definitions of struct pci_device_id arrays should generally follow
the same pattern across the entire kernel. This macro defines this
array as const and puts it into the __devinitconst section.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
include/linux/pci.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 87195b6..c7a91b1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -389,6 +389,15 @@ struct pci_driver {
#define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
/**
+ * PCI_DEVICE_TABLE - macro used to describe a pci device table
+ * @_table: device table name
+ *
+ * This macro is used to create a struct pci_device_id array (a device table)
+ * in a generic manner.
+ */
+#define PCI_DEVICE_TABLE(_table) const struct pci_device_id _table[] __devinitconst
+
+/**
* PCI_DEVICE - macro used to describe a specific pci device
* @vend: the 16 bit PCI Vendor ID
* @dev: the 16 bit PCI Device ID
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-18 4:48 ` Greg KH
@ 2008-02-18 7:34 ` Jonas Bonn
2008-02-20 16:11 ` Greg KH
0 siblings, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-18 7:34 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, olof, sam
>
> And again, what does this buy us?
>
Clarity and simplicity, I hope... there are a bunch of definitions
scattered about the kernel that omit the __devinitdata modifier despite
the documentation stating that it should always be there. The
definition really should have been const, which wasn't possible before
but has become so with the addition of the __devinitconst attribute.
Furthermore, there are definitions that use "const" and __devinitdata,
which is explicitly wrong but the compiler doesn't catch section
mismatches if there's only one such one case in the module (which is
often the case).
Adding the __devinitconst modifier where there was nothing before buys
us memory. Adding the const modifier gives the compiler a chance to do
its thing. Changing __devinitdata to __devinitconst where it was wrong
actually fixes some compiler errors in older (mid-release) kernels that
were patched over by "removing" the section attribute altogether (which
wastes memory).
Adding the macro (Olof's idea, not mine) makes it pretty difficult to
get this definition wrong... I'll do the rest of the cleanup, but I need
to know whether it's better to use a macro like this, or to open code
the definitions. I prefer the macro approach...
Hope this makes some sense...
/Jonas
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-17 12:13 ` Jonas Bonn
@ 2008-02-18 4:48 ` Greg KH
2008-02-18 7:34 ` Jonas Bonn
0 siblings, 1 reply; 28+ messages in thread
From: Greg KH @ 2008-02-18 4:48 UTC (permalink / raw)
To: Jonas Bonn; +Cc: linux-kernel, olof, sam
On Sun, Feb 17, 2008 at 01:13:24PM +0100, Jonas Bonn wrote:
> I'm a bit uncertain whether the definition really should include the
> 'static' modifier... for most definitions of these tables this is ok,
> but there are a couple of cases where it should not be static, so the
> line would need to be open-coded again...
Yes, please don't make it static.
And again, what does this buy us?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-17 12:10 Jonas Bonn
2008-02-17 12:13 ` Jonas Bonn
@ 2008-02-17 18:14 ` Randy Dunlap
1 sibling, 0 replies; 28+ messages in thread
From: Randy Dunlap @ 2008-02-17 18:14 UTC (permalink / raw)
To: Jonas Bonn; +Cc: linux-kernel, greg, olof, sam
On Sun, 17 Feb 2008 13:10:05 +0100 Jonas Bonn wrote:
> The definitions of struct pci_device_id arrays should generally follow
> the same pattern across the entire kernel. This macro defines this
> array as static const and puts it into the __devinitconst section.
>
> Signed-off-by: Jonas Bonn <jonas@southpole.se>
> ---
> include/linux/pci.h | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 87195b6..487d31c 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -389,6 +389,14 @@ struct pci_driver {
> #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
>
> /**
> + * PCI_DEVICE_TABLE - macro used to describe a pci device table
> + *
> + * This macro is used to create a struct pci_device_id array in a generic
> + * manner.
> + */
> +#define PCI_DEVICE_TABLE(_table) static const struct pci_device_id _table[] __devinitconst
> +
> +/**
> * PCI_DEVICE - macro used to describe a specific pci device
> * @vend: the 16 bit PCI Vendor ID
> * @dev: the 16 bit PCI Device ID
> --
Missing kernel-doc notation for the _table parameter. See the
parameters for PCI_DEVICE() below for an example.
---
~Randy
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] Add PCI_DEVICE_TABLE macro
2008-02-17 12:10 Jonas Bonn
@ 2008-02-17 12:13 ` Jonas Bonn
2008-02-18 4:48 ` Greg KH
2008-02-17 18:14 ` Randy Dunlap
1 sibling, 1 reply; 28+ messages in thread
From: Jonas Bonn @ 2008-02-17 12:13 UTC (permalink / raw)
To: linux-kernel; +Cc: greg, olof, sam
[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]
I'm a bit uncertain whether the definition really should include the
'static' modifier... for most definitions of these tables this is ok,
but there are a couple of cases where it should not be static, so the
line would need to be open-coded again...
/Jonas
On Sun, 2008-02-17 at 13:10 +0100, Jonas Bonn wrote:
> The definitions of struct pci_device_id arrays should generally follow
> the same pattern across the entire kernel. This macro defines this
> array as static const and puts it into the __devinitconst section.
>
> Signed-off-by: Jonas Bonn <jonas@southpole.se>
> ---
> include/linux/pci.h | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 87195b6..487d31c 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -389,6 +389,14 @@ struct pci_driver {
> #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
>
> /**
> + * PCI_DEVICE_TABLE - macro used to describe a pci device table
> + *
> + * This macro is used to create a struct pci_device_id array in a generic
> + * manner.
> + */
> +#define PCI_DEVICE_TABLE(_table) static const struct pci_device_id _table[] __devinitconst
> +
> +/**
> * PCI_DEVICE - macro used to describe a specific pci device
> * @vend: the 16 bit PCI Vendor ID
> * @dev: the 16 bit PCI Device ID
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] Add PCI_DEVICE_TABLE macro
@ 2008-02-17 12:10 Jonas Bonn
2008-02-17 12:13 ` Jonas Bonn
2008-02-17 18:14 ` Randy Dunlap
0 siblings, 2 replies; 28+ messages in thread
From: Jonas Bonn @ 2008-02-17 12:10 UTC (permalink / raw)
To: linux-kernel, greg; +Cc: olof, sam, Jonas Bonn
The definitions of struct pci_device_id arrays should generally follow
the same pattern across the entire kernel. This macro defines this
array as static const and puts it into the __devinitconst section.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
include/linux/pci.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 87195b6..487d31c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -389,6 +389,14 @@ struct pci_driver {
#define to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
/**
+ * PCI_DEVICE_TABLE - macro used to describe a pci device table
+ *
+ * This macro is used to create a struct pci_device_id array in a generic
+ * manner.
+ */
+#define PCI_DEVICE_TABLE(_table) static const struct pci_device_id _table[] __devinitconst
+
+/**
* PCI_DEVICE - macro used to describe a specific pci device
* @vend: the 16 bit PCI Vendor ID
* @dev: the 16 bit PCI Device ID
--
1.5.3.8
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2008-02-20 17:05 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20 12:53 pci_device_id cleanups Jonas Bonn
2008-02-20 12:53 ` [PATCH] Add PCI_DEVICE_TABLE macro Jonas Bonn
2008-02-20 12:53 ` [PATCH] [net] use PCI_DEVICE_TABLE: makes struct pci_device_id array const and adds section attribute __devinitconst Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 12:53 ` Jonas Bonn
2008-02-20 13:17 ` pci_device_id cleanups Sam Ravnborg
2008-02-20 13:27 ` Jonas Bonn
2008-02-20 13:55 ` PowerPC toolchain for x86 [Was: pci_device_id cleanups] Sam Ravnborg
2008-02-20 14:03 ` Jonas Bonn
-- strict thread matches above, loose matches on Subject: below --
2008-02-18 8:03 [PATCH] Add PCI_DEVICE_TABLE macro Jonas Bonn
2008-02-17 12:10 Jonas Bonn
2008-02-17 12:13 ` Jonas Bonn
2008-02-18 4:48 ` Greg KH
2008-02-18 7:34 ` Jonas Bonn
2008-02-20 16:11 ` Greg KH
2008-02-20 17:05 ` Jeff Garzik
2008-02-17 18:14 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).