Skip to contentSkip to conversation

net: cleanup CONFIG_PCI from dgrs.c

PATCH In review Richard Knutsson 2 participants 3 messages Apr 9, 2006 – Apr 10, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: cleanup CONFIG_PCI from dgrs.c

From: Richard Knutsson <[email protected]>

Removed (I believe) unnecessary CONFIG_PCI and an ugly (previous patch of mine) empty struct if !CONFIG_PCI.

Compiled tested, with and without an "#undef CONFIG_PCI" in dgrs.c, with no warnings/errors.

---

 dgrs.c |    8 +-------
 1 files changed, 1 insertion(+), 7 deletions(-)
drivers/net/dgrs.c +1 -7
diff -Narup a/drivers/net/dgrs.c b/drivers/net/dgrs.c
@@ -121,11 +121,11 @@ typedef unsigned int bool;
 #include "dgrs_asstruct.h"
 #include "dgrs_bcomm.h"
 
-#ifdef CONFIG_PCI
 static struct pci_device_id dgrs_pci_tbl[] = {
 	{ SE6_PCI_VENDOR_ID, SE6_PCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, },
 	{ }			/* Terminating entry */
 };
+#ifdef CONFIG_PCI
 MODULE_DEVICE_TABLE(pci, dgrs_pci_tbl);
 #endif
 
@@ -1381,7 +1381,6 @@ static void __devexit dgrs_remove(struct
 	}
 }
 
-#ifdef CONFIG_PCI
 static int __init dgrs_pci_probe(struct pci_dev *pdev,
 				 const struct pci_device_id *ent)
 {
@@ -1458,9 +1457,6 @@ static struct pci_driver dgrs_pci_driver
 	.probe = dgrs_pci_probe,
 	.remove = __devexit_p(dgrs_pci_remove),
 };
-#else
-static struct pci_driver dgrs_pci_driver = {};
-#endif
 
 
 #ifdef CONFIG_EISA
@@ -1608,9 +1604,7 @@ static void __exit dgrs_cleanup_module (
 #ifdef CONFIG_EISA
 	eisa_driver_unregister (&dgrs_eisa_driver);
 #endif
-#ifdef CONFIG_PCI
 	pci_unregister_driver (&dgrs_pci_driver);
-#endif
 }
 
 module_init(dgrs_init_module);

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 9 lines · Richard Knutsson

From: Richard Knutsson <[email protected]>

Removed (I believe) unnecessary CONFIG_PCI and an ugly (previous patch of mine) empty struct if !CONFIG_PCI.

Compiled tested, with and without an "#undef CONFIG_PCI" in dgrs.c, with no warnings/errors.

If !CONFIG_PCI we don't want to be compiling that relatively large but unused dgrs_pci_probe() into the object file.;

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Richard Knutsson
Quoted 8 lines · Andrew Morton
Quoted 5 lines · Richard Knutsson

From: Richard Knutsson <[email protected]>

Removed (I believe) unnecessary CONFIG_PCI and an ugly (previous patch of mine) empty struct if !CONFIG_PCI.

Quoted 10 lines
Quoted 5 lines

Compiled tested, with and without an "#undef CONFIG_PCI" in dgrs.c, with no warnings/errors.

If !CONFIG_PCI we don't want to be compiling that relatively large but unused dgrs_pci_probe() into the object file.;

Oh, sorry about that. Thought the compiler optimized those away. Have looked through the Makefile now (better late then never, right?)
_______________________________________________
Kernel-janitors mailing list [email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors