summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-01-29 06:39:11 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-29 23:33:38 -0500
commit747a11279a442b913a57bf38934879babab3b58b (patch)
treea5ee5312e6c9137ebb882e506b7ca83b155dfb5f
parent84092996673211f16ef3b942a191d7952e9dfea9 (diff)
net: hp100: remove unnecessary #ifdefs
Building the hp100 ethernet driver causes warnings when both the PCI and EISA drivers are disabled: ethernet/hp/hp100.c: In function 'hp100_module_init': ethernet/hp/hp100.c:3047:2: warning: label 'out3' defined but not used [-Wunused-label] ethernet/hp/hp100.c: At top level: ethernet/hp/hp100.c:2828:13: warning: 'cleanup_dev' defined but not used [-Wunused-function] We can easily avoid the warnings and make the driver look slightly nicer by removing the #ifdefs that check for the CONFIG_PCI and CONFIG_EISA, as all the registration functions are designed to have no effect when the buses are disabled. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/hp/hp100.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index 1d5c3e16d8f4..3daf2d4a7ca0 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -194,7 +194,6 @@ static const char *hp100_isa_tbl[] = {
194}; 194};
195#endif 195#endif
196 196
197#ifdef CONFIG_EISA
198static struct eisa_device_id hp100_eisa_tbl[] = { 197static struct eisa_device_id hp100_eisa_tbl[] = {
199 { "HWPF180" }, /* HP J2577 rev A */ 198 { "HWPF180" }, /* HP J2577 rev A */
200 { "HWP1920" }, /* HP 27248B */ 199 { "HWP1920" }, /* HP 27248B */
@@ -205,9 +204,7 @@ static struct eisa_device_id hp100_eisa_tbl[] = {
205 { "" } /* Mandatory final entry ! */ 204 { "" } /* Mandatory final entry ! */
206}; 205};
207MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl); 206MODULE_DEVICE_TABLE(eisa, hp100_eisa_tbl);
208#endif
209 207
210#ifdef CONFIG_PCI
211static const struct pci_device_id hp100_pci_tbl[] = { 208static const struct pci_device_id hp100_pci_tbl[] = {
212 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,}, 209 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585A, PCI_ANY_ID, PCI_ANY_ID,},
213 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,}, 210 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_J2585B, PCI_ANY_ID, PCI_ANY_ID,},
@@ -219,7 +216,6 @@ static const struct pci_device_id hp100_pci_tbl[] = {
219 {} /* Terminating entry */ 216 {} /* Terminating entry */
220}; 217};
221MODULE_DEVICE_TABLE(pci, hp100_pci_tbl); 218MODULE_DEVICE_TABLE(pci, hp100_pci_tbl);
222#endif
223 219
224static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO; 220static int hp100_rx_ratio = HP100_DEFAULT_RX_RATIO;
225static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX; 221static int hp100_priority_tx = HP100_DEFAULT_PRIORITY_TX;
@@ -2842,7 +2838,6 @@ static void cleanup_dev(struct net_device *d)
2842 free_netdev(d); 2838 free_netdev(d);
2843} 2839}
2844 2840
2845#ifdef CONFIG_EISA
2846static int hp100_eisa_probe(struct device *gendev) 2841static int hp100_eisa_probe(struct device *gendev)
2847{ 2842{
2848 struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private)); 2843 struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
@@ -2884,9 +2879,7 @@ static struct eisa_driver hp100_eisa_driver = {
2884 .remove = hp100_eisa_remove, 2879 .remove = hp100_eisa_remove,
2885 } 2880 }
2886}; 2881};
2887#endif
2888 2882
2889#ifdef CONFIG_PCI
2890static int hp100_pci_probe(struct pci_dev *pdev, 2883static int hp100_pci_probe(struct pci_dev *pdev,
2891 const struct pci_device_id *ent) 2884 const struct pci_device_id *ent)
2892{ 2885{
@@ -2955,7 +2948,6 @@ static struct pci_driver hp100_pci_driver = {
2955 .probe = hp100_pci_probe, 2948 .probe = hp100_pci_probe,
2956 .remove = hp100_pci_remove, 2949 .remove = hp100_pci_remove,
2957}; 2950};
2958#endif
2959 2951
2960/* 2952/*
2961 * module section 2953 * module section
@@ -3032,23 +3024,17 @@ static int __init hp100_module_init(void)
3032 err = hp100_isa_init(); 3024 err = hp100_isa_init();
3033 if (err && err != -ENODEV) 3025 if (err && err != -ENODEV)
3034 goto out; 3026 goto out;
3035#ifdef CONFIG_EISA
3036 err = eisa_driver_register(&hp100_eisa_driver); 3027 err = eisa_driver_register(&hp100_eisa_driver);
3037 if (err && err != -ENODEV) 3028 if (err && err != -ENODEV)
3038 goto out2; 3029 goto out2;
3039#endif
3040#ifdef CONFIG_PCI
3041 err = pci_register_driver(&hp100_pci_driver); 3030 err = pci_register_driver(&hp100_pci_driver);
3042 if (err && err != -ENODEV) 3031 if (err && err != -ENODEV)
3043 goto out3; 3032 goto out3;
3044#endif
3045 out: 3033 out:
3046 return err; 3034 return err;
3047 out3: 3035 out3:
3048#ifdef CONFIG_EISA
3049 eisa_driver_unregister (&hp100_eisa_driver); 3036 eisa_driver_unregister (&hp100_eisa_driver);
3050 out2: 3037 out2:
3051#endif
3052 hp100_isa_cleanup(); 3038 hp100_isa_cleanup();
3053 goto out; 3039 goto out;
3054} 3040}
@@ -3057,12 +3043,8 @@ static int __init hp100_module_init(void)
3057static void __exit hp100_module_exit(void) 3043static void __exit hp100_module_exit(void)
3058{ 3044{
3059 hp100_isa_cleanup(); 3045 hp100_isa_cleanup();
3060#ifdef CONFIG_EISA
3061 eisa_driver_unregister (&hp100_eisa_driver); 3046 eisa_driver_unregister (&hp100_eisa_driver);
3062#endif
3063#ifdef CONFIG_PCI
3064 pci_unregister_driver (&hp100_pci_driver); 3047 pci_unregister_driver (&hp100_pci_driver);
3065#endif
3066} 3048}
3067 3049
3068module_init(hp100_module_init) 3050module_init(hp100_module_init)