aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-06 14:56:04 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-06 14:56:04 -0400
commitc31f28e778ab299a5035ea2bda64f245b8915d7c (patch)
tree92d1070b0ae0c3528ab2c8787c4402fd8adf5a5f
parent86d91bab4806191a8126502d80d729c2a4765ebe (diff)
drivers/net: eliminate irq handler impossible checks, needless casts
- Eliminate check for irq handler 'dev_id==NULL' where the condition never occurs. - Eliminate needless casts to/from void* Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/3c509.c7
-rw-r--r--drivers/net/3c523.c7
-rw-r--r--drivers/net/3c527.c5
-rw-r--r--drivers/net/8390.c8
-rw-r--r--drivers/net/atp.c6
-rw-r--r--drivers/net/de600.c6
-rw-r--r--drivers/net/declance.c4
-rw-r--r--drivers/net/dgrs.c4
-rw-r--r--drivers/net/eepro.c8
-rw-r--r--drivers/net/eexpress.c7
-rw-r--r--drivers/net/irda/ali-ircc.c10
-rw-r--r--drivers/net/irda/donauboe.c11
-rw-r--r--drivers/net/irda/irport.c8
-rw-r--r--drivers/net/irda/irport.h2
-rw-r--r--drivers/net/irda/nsc-ircc.c9
-rw-r--r--drivers/net/irda/w83977af_ir.c9
-rw-r--r--drivers/net/lance.c5
-rw-r--r--drivers/net/pcmcia/axnet_cs.c8
-rw-r--r--drivers/net/pcnet32.c7
-rw-r--r--drivers/net/plip.c5
-rw-r--r--drivers/net/saa9730.c2
-rw-r--r--drivers/net/sb1000.c8
-rw-r--r--drivers/net/skfp/skfddi.c7
-rw-r--r--drivers/net/sonic.c7
-rw-r--r--drivers/net/sunhme.c4
-rw-r--r--drivers/net/sunlance.c2
-rw-r--r--drivers/net/sunqe.c2
-rw-r--r--drivers/net/tokenring/smctr.c7
-rw-r--r--drivers/net/tokenring/tms380tr.c5
-rw-r--r--drivers/net/tulip/de4x5.c6
-rw-r--r--drivers/net/wan/cycx_main.c4
-rw-r--r--drivers/net/wan/sdla.c8
-rw-r--r--drivers/net/wireless/orinoco.c2
-rw-r--r--drivers/net/wireless/wavelan_cs.c11
-rw-r--r--drivers/net/wireless/wl3501_cs.c15
-rw-r--r--drivers/net/yellowfin.c7
-rw-r--r--drivers/net/znet.c5
37 files changed, 39 insertions, 199 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 7ad0a54779c4..f791bf026e51 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
912static irqreturn_t 912static irqreturn_t
913el3_interrupt(int irq, void *dev_id) 913el3_interrupt(int irq, void *dev_id)
914{ 914{
915 struct net_device *dev = (struct net_device *)dev_id; 915 struct net_device *dev = dev_id;
916 struct el3_private *lp; 916 struct el3_private *lp;
917 int ioaddr, status; 917 int ioaddr, status;
918 int i = max_interrupt_work; 918 int i = max_interrupt_work;
919 919
920 if (dev == NULL) {
921 printk ("el3_interrupt(): irq %d for unknown device.\n", irq);
922 return IRQ_NONE;
923 }
924
925 lp = netdev_priv(dev); 920 lp = netdev_priv(dev);
926 spin_lock(&lp->lock); 921 spin_lock(&lp->lock);
927 922
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 1c97271112d0..91849469b4f4 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr)
902static irqreturn_t 902static irqreturn_t
903elmc_interrupt(int irq, void *dev_id) 903elmc_interrupt(int irq, void *dev_id)
904{ 904{
905 struct net_device *dev = (struct net_device *) dev_id; 905 struct net_device *dev = dev_id;
906 unsigned short stat; 906 unsigned short stat;
907 struct priv *p; 907 struct priv *p;
908 908
909 if (dev == NULL) { 909 if (!netif_running(dev)) {
910 printk(KERN_ERR "elmc-interrupt: irq %d for unknown device.\n", irq);
911 return IRQ_NONE;
912 } else if (!netif_running(dev)) {
913 /* The 3c523 has this habit of generating interrupts during the 910 /* The 3c523 has this habit of generating interrupts during the
914 reset. I'm not sure if the ni52 has this same problem, but it's 911 reset. I'm not sure if the ni52 has this same problem, but it's
915 really annoying if we haven't finished initializing it. I was 912 really annoying if we haven't finished initializing it. I was
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index d516c3225ca4..f4aca5386add 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id)
1324 int rx_event = 0; 1324 int rx_event = 0;
1325 int tx_event = 0; 1325 int tx_event = 0;
1326 1326
1327 if (dev == NULL) {
1328 printk(KERN_WARNING "%s: irq %d for unknown device.\n", cardname, irq);
1329 return IRQ_NONE;
1330 }
1331
1332 ioaddr = dev->base_addr; 1327 ioaddr = dev->base_addr;
1333 lp = netdev_priv(dev); 1328 lp = netdev_priv(dev);
1334 1329
diff --git a/drivers/net/8390.c b/drivers/net/8390.c
index fa3442cb1a49..3d1c599ac3cb 100644
--- a/drivers/net/8390.c
+++ b/drivers/net/8390.c
@@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id)
406 int interrupts, nr_serviced = 0; 406 int interrupts, nr_serviced = 0;
407 struct ei_device *ei_local; 407 struct ei_device *ei_local;
408 408
409 if (dev == NULL)
410 {
411 printk ("net_interrupt(): irq %d for unknown device.\n", irq);
412 return IRQ_NONE;
413 }
414
415 e8390_base = dev->base_addr; 409 e8390_base = dev->base_addr;
416 ei_local = (struct ei_device *) netdev_priv(dev); 410 ei_local = netdev_priv(dev);
417 411
418 /* 412 /*
419 * Protect the irq test too. 413 * Protect the irq test too.
diff --git a/drivers/net/atp.c b/drivers/net/atp.c
index 062f80e20874..2d306fcb7f36 100644
--- a/drivers/net/atp.c
+++ b/drivers/net/atp.c
@@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
598 Handle the network interface interrupts. */ 598 Handle the network interface interrupts. */
599static irqreturn_t atp_interrupt(int irq, void *dev_instance) 599static irqreturn_t atp_interrupt(int irq, void *dev_instance)
600{ 600{
601 struct net_device *dev = (struct net_device *)dev_instance; 601 struct net_device *dev = dev_instance;
602 struct net_local *lp; 602 struct net_local *lp;
603 long ioaddr; 603 long ioaddr;
604 static int num_tx_since_rx; 604 static int num_tx_since_rx;
605 int boguscount = max_interrupt_work; 605 int boguscount = max_interrupt_work;
606 int handled = 0; 606 int handled = 0;
607 607
608 if (dev == NULL) {
609 printk(KERN_ERR "ATP_interrupt(): irq %d for unknown device.\n", irq);
610 return IRQ_NONE;
611 }
612 ioaddr = dev->base_addr; 608 ioaddr = dev->base_addr;
613 lp = netdev_priv(dev); 609 lp = netdev_priv(dev);
614 610
diff --git a/drivers/net/de600.c b/drivers/net/de600.c
index d9b006c9e367..690bb40b353d 100644
--- a/drivers/net/de600.c
+++ b/drivers/net/de600.c
@@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id)
265 int retrig = 0; 265 int retrig = 0;
266 int boguscount = 0; 266 int boguscount = 0;
267 267
268 /* This might just as well be deleted now, no crummy drivers present :-) */
269 if ((dev == NULL) || (DE600_IRQ != irq)) {
270 printk(KERN_ERR "%s: bogus interrupt %d\n", dev?dev->name:"DE-600", irq);
271 return IRQ_NONE;
272 }
273
274 spin_lock(&de600_lock); 268 spin_lock(&de600_lock);
275 269
276 select_nic(); 270 select_nic();
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index e179aa1c1ba0..00e2a8a134d7 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -696,7 +696,7 @@ out:
696 696
697static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) 697static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
698{ 698{
699 struct net_device *dev = (struct net_device *) dev_id; 699 struct net_device *dev = dev_id;
700 700
701 printk("%s: DMA error\n", dev->name); 701 printk("%s: DMA error\n", dev->name);
702 return IRQ_HANDLED; 702 return IRQ_HANDLED;
@@ -704,7 +704,7 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
704 704
705static irqreturn_t lance_interrupt(const int irq, void *dev_id) 705static irqreturn_t lance_interrupt(const int irq, void *dev_id)
706{ 706{
707 struct net_device *dev = (struct net_device *) dev_id; 707 struct net_device *dev = dev_id;
708 struct lance_private *lp = netdev_priv(dev); 708 struct lance_private *lp = netdev_priv(dev);
709 volatile struct lance_regs *ll = lp->ll; 709 volatile struct lance_regs *ll = lp->ll;
710 int csr0; 710 int csr0;
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c
index 6b1234b09fb3..a79520295fd0 100644
--- a/drivers/net/dgrs.c
+++ b/drivers/net/dgrs.c
@@ -897,8 +897,8 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd)
897 897
898static irqreturn_t dgrs_intr(int irq, void *dev_id) 898static irqreturn_t dgrs_intr(int irq, void *dev_id)
899{ 899{
900 struct net_device *dev0 = (struct net_device *) dev_id; 900 struct net_device *dev0 = dev_id;
901 DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv; 901 DGRS_PRIV *priv0 = dev0->priv;
902 I596_CB *cbp; 902 I596_CB *cbp;
903 int cmd; 903 int cmd;
904 int i; 904 int i;
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index aae454aaa1c6..fd6e97891e73 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -1198,17 +1198,11 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
1198static irqreturn_t 1198static irqreturn_t
1199eepro_interrupt(int irq, void *dev_id) 1199eepro_interrupt(int irq, void *dev_id)
1200{ 1200{
1201 struct net_device *dev = (struct net_device *)dev_id; 1201 struct net_device *dev = dev_id;
1202 /* (struct net_device *)(irq2dev_map[irq]);*/
1203 struct eepro_local *lp; 1202 struct eepro_local *lp;
1204 int ioaddr, status, boguscount = 20; 1203 int ioaddr, status, boguscount = 20;
1205 int handled = 0; 1204 int handled = 0;
1206 1205
1207 if (dev == NULL) {
1208 printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq);
1209 return IRQ_NONE;
1210 }
1211
1212 lp = netdev_priv(dev); 1206 lp = netdev_priv(dev);
1213 1207
1214 spin_lock(&lp->lock); 1208 spin_lock(&lp->lock);
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index 05ca730fe81e..e14be020e562 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -796,13 +796,6 @@ static irqreturn_t eexp_irq(int irq, void *dev_info)
796 unsigned short ioaddr,status,ack_cmd; 796 unsigned short ioaddr,status,ack_cmd;
797 unsigned short old_read_ptr, old_write_ptr; 797 unsigned short old_read_ptr, old_write_ptr;
798 798
799 if (dev==NULL)
800 {
801 printk(KERN_WARNING "eexpress: irq %d for unknown device\n",
802 irq);
803 return IRQ_NONE;
804 }
805
806 lp = netdev_priv(dev); 799 lp = netdev_priv(dev);
807 ioaddr = dev->base_addr; 800 ioaddr = dev->base_addr;
808 801
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index 971e2dee1e6b..cebf8c374bc5 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -662,19 +662,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info)
662 */ 662 */
663static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) 663static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id)
664{ 664{
665 struct net_device *dev = (struct net_device *) dev_id; 665 struct net_device *dev = dev_id;
666 struct ali_ircc_cb *self; 666 struct ali_ircc_cb *self;
667 int ret; 667 int ret;
668 668
669 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); 669 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
670 670
671 if (!dev) { 671 self = dev->priv;
672 IRDA_WARNING("%s: irq %d for unknown device.\n",
673 ALI_IRCC_DRIVER_NAME, irq);
674 return IRQ_NONE;
675 }
676
677 self = (struct ali_ircc_cb *) dev->priv;
678 672
679 spin_lock(&self->lock); 673 spin_lock(&self->lock);
680 674
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 7a9128181e68..636d0630fe02 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -657,12 +657,6 @@ toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt)
657 return xbofs; 657 return xbofs;
658} 658}
659 659
660static int toshoboe_invalid_dev(int irq)
661{
662 printk (KERN_WARNING DRIVER_NAME ": irq %d for unknown device.\n", irq);
663 return 1;
664}
665
666#ifdef USE_PROBE 660#ifdef USE_PROBE
667/***********************************************************************/ 661/***********************************************************************/
668/* Probe code */ 662/* Probe code */
@@ -711,12 +705,9 @@ stuff_byte (__u8 byte, __u8 * buf)
711static irqreturn_t 705static irqreturn_t
712toshoboe_probeinterrupt (int irq, void *dev_id) 706toshoboe_probeinterrupt (int irq, void *dev_id)
713{ 707{
714 struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; 708 struct toshoboe_cb *self = dev_id;
715 __u8 irqstat; 709 __u8 irqstat;
716 710
717 if (self == NULL && toshoboe_invalid_dev(irq))
718 return IRQ_NONE;
719
720 irqstat = INB (OBOE_ISR); 711 irqstat = INB (OBOE_ISR);
721 712
722/* was it us */ 713/* was it us */
diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c
index 6ea78ececca7..654a68b490ae 100644
--- a/drivers/net/irda/irport.c
+++ b/drivers/net/irda/irport.c
@@ -766,18 +766,14 @@ static inline void irport_receive(struct irport_cb *self)
766 */ 766 */
767static irqreturn_t irport_interrupt(int irq, void *dev_id) 767static irqreturn_t irport_interrupt(int irq, void *dev_id)
768{ 768{
769 struct net_device *dev = (struct net_device *) dev_id; 769 struct net_device *dev = dev_id;
770 struct irport_cb *self; 770 struct irport_cb *self;
771 int boguscount = 0; 771 int boguscount = 0;
772 int iobase; 772 int iobase;
773 int iir, lsr; 773 int iir, lsr;
774 int handled = 0; 774 int handled = 0;
775 775
776 if (!dev) { 776 self = dev->priv;
777 IRDA_WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq);
778 return IRQ_NONE;
779 }
780 self = (struct irport_cb *) dev->priv;
781 777
782 spin_lock(&self->lock); 778 spin_lock(&self->lock);
783 779
diff --git a/drivers/net/irda/irport.h b/drivers/net/irda/irport.h
index 4393168347e3..3f46b84c6c85 100644
--- a/drivers/net/irda/irport.h
+++ b/drivers/net/irda/irport.h
@@ -74,7 +74,7 @@ struct irport_cb {
74 /* For piggyback drivers */ 74 /* For piggyback drivers */
75 void *priv; 75 void *priv;
76 void (*change_speed)(void *priv, __u32 speed); 76 void (*change_speed)(void *priv, __u32 speed);
77 int (*interrupt)(int irq, void *dev_id); 77 irqreturn_t (*interrupt)(int irq, void *dev_id);
78}; 78};
79 79
80#endif /* IRPORT_H */ 80#endif /* IRPORT_H */
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index ea12e999814a..29b5ccd29d0b 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -2068,17 +2068,12 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
2068 */ 2068 */
2069static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id) 2069static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id)
2070{ 2070{
2071 struct net_device *dev = (struct net_device *) dev_id; 2071 struct net_device *dev = dev_id;
2072 struct nsc_ircc_cb *self; 2072 struct nsc_ircc_cb *self;
2073 __u8 bsr, eir; 2073 __u8 bsr, eir;
2074 int iobase; 2074 int iobase;
2075 2075
2076 if (!dev) { 2076 self = dev->priv;
2077 IRDA_WARNING("%s: irq %d for unknown device.\n",
2078 driver_name, irq);
2079 return IRQ_NONE;
2080 }
2081 self = (struct nsc_ircc_cb *) dev->priv;
2082 2077
2083 spin_lock(&self->lock); 2078 spin_lock(&self->lock);
2084 2079
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index b4fb92a7baa8..4212657fa4f9 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -1113,17 +1113,12 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr)
1113 */ 1113 */
1114static irqreturn_t w83977af_interrupt(int irq, void *dev_id) 1114static irqreturn_t w83977af_interrupt(int irq, void *dev_id)
1115{ 1115{
1116 struct net_device *dev = (struct net_device *) dev_id; 1116 struct net_device *dev = dev_id;
1117 struct w83977af_ir *self; 1117 struct w83977af_ir *self;
1118 __u8 set, icr, isr; 1118 __u8 set, icr, isr;
1119 int iobase; 1119 int iobase;
1120 1120
1121 if (!dev) { 1121 self = dev->priv;
1122 printk(KERN_WARNING "%s: irq %d for unknown device.\n",
1123 driver_name, irq);
1124 return IRQ_NONE;
1125 }
1126 self = (struct w83977af_ir *) dev->priv;
1127 1122
1128 iobase = self->io.fir_base; 1123 iobase = self->io.fir_base;
1129 1124
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index 7afac47e59ad..6efbd499d752 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -1019,11 +1019,6 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id)
1019 int csr0, ioaddr, boguscnt=10; 1019 int csr0, ioaddr, boguscnt=10;
1020 int must_restart; 1020 int must_restart;
1021 1021
1022 if (dev == NULL) {
1023 printk ("lance_interrupt(): irq %d for unknown device.\n", irq);
1024 return IRQ_NONE;
1025 }
1026
1027 ioaddr = dev->base_addr; 1022 ioaddr = dev->base_addr;
1028 lp = dev->priv; 1023 lp = dev->priv;
1029 1024
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index e5f366910914..5ddd5742f779 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -1201,14 +1201,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1201 struct ei_device *ei_local; 1201 struct ei_device *ei_local;
1202 int handled = 0; 1202 int handled = 0;
1203 1203
1204 if (dev == NULL)
1205 {
1206 printk ("net_interrupt(): irq %d for unknown device.\n", irq);
1207 return IRQ_NONE;
1208 }
1209
1210 e8390_base = dev->base_addr; 1204 e8390_base = dev->base_addr;
1211 ei_local = (struct ei_device *) netdev_priv(dev); 1205 ei_local = netdev_priv(dev);
1212 1206
1213 /* 1207 /*
1214 * Protect the irq test too. 1208 * Protect the irq test too.
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index c73e2f210774..36f9d988278f 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -2569,13 +2569,6 @@ pcnet32_interrupt(int irq, void *dev_id)
2569 u16 csr0; 2569 u16 csr0;
2570 int boguscnt = max_interrupt_work; 2570 int boguscnt = max_interrupt_work;
2571 2571
2572 if (!dev) {
2573 if (pcnet32_debug & NETIF_MSG_INTR)
2574 printk(KERN_DEBUG "%s(): irq %d for unknown device\n",
2575 __FUNCTION__, irq);
2576 return IRQ_NONE;
2577 }
2578
2579 ioaddr = dev->base_addr; 2572 ioaddr = dev->base_addr;
2580 lp = dev->priv; 2573 lp = dev->priv;
2581 2574
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index c0b333d2917a..71afb274498f 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -909,11 +909,6 @@ plip_interrupt(int irq, void *dev_id)
909 struct plip_local *rcv; 909 struct plip_local *rcv;
910 unsigned char c0; 910 unsigned char c0;
911 911
912 if (dev == NULL) {
913 printk(KERN_DEBUG "plip_interrupt: irq %d for unknown device.\n", irq);
914 return;
915 }
916
917 nl = netdev_priv(dev); 912 nl = netdev_priv(dev);
918 rcv = &nl->rcv_data; 913 rcv = &nl->rcv_data;
919 914
diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c
index c9efad8a917e..b269513cde45 100644
--- a/drivers/net/saa9730.c
+++ b/drivers/net/saa9730.c
@@ -747,7 +747,7 @@ static int lan_saa9730_rx(struct net_device *dev)
747 747
748static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id) 748static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id)
749{ 749{
750 struct net_device *dev = (struct net_device *) dev_id; 750 struct net_device *dev = dev_id;
751 struct lan_saa9730_private *lp = netdev_priv(dev); 751 struct lan_saa9730_private *lp = netdev_priv(dev);
752 752
753 if (lan_saa9730_debug > 5) 753 if (lan_saa9730_debug > 5)
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index dc30dee5537f..b9fa4fbb1398 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -1084,19 +1084,13 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id)
1084 char *name; 1084 char *name;
1085 unsigned char st; 1085 unsigned char st;
1086 int ioaddr[2]; 1086 int ioaddr[2];
1087 struct net_device *dev = (struct net_device *) dev_id; 1087 struct net_device *dev = dev_id;
1088 struct sb1000_private *lp = netdev_priv(dev); 1088 struct sb1000_private *lp = netdev_priv(dev);
1089 1089
1090 const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; 1090 const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00};
1091 const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; 1091 const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
1092 const int MaxRxErrorCount = 6; 1092 const int MaxRxErrorCount = 6;
1093 1093
1094 if (dev == NULL) {
1095 printk(KERN_ERR "sb1000_interrupt(): irq %d for unknown device.\n",
1096 irq);
1097 return IRQ_NONE;
1098 }
1099
1100 ioaddr[0] = dev->base_addr; 1094 ioaddr[0] = dev->base_addr;
1101 /* mem_start holds the second I/O address */ 1095 /* mem_start holds the second I/O address */
1102 ioaddr[1] = dev->mem_start; 1096 ioaddr[1] = dev->mem_start;
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 06ea2626c6f4..9733a11c6146 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -616,15 +616,10 @@ static int skfp_close(struct net_device *dev)
616 616
617irqreturn_t skfp_interrupt(int irq, void *dev_id) 617irqreturn_t skfp_interrupt(int irq, void *dev_id)
618{ 618{
619 struct net_device *dev = (struct net_device *) dev_id; 619 struct net_device *dev = dev_id;
620 struct s_smc *smc; /* private board structure pointer */ 620 struct s_smc *smc; /* private board structure pointer */
621 skfddi_priv *bp; 621 skfddi_priv *bp;
622 622
623 if (dev == NULL) {
624 printk("%s: irq %d for unknown device\n", dev->name, irq);
625 return IRQ_NONE;
626 }
627
628 smc = netdev_priv(dev); 623 smc = netdev_priv(dev);
629 bp = &smc->os; 624 bp = &smc->os;
630 625
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c
index cfece9676aff..ed7aa0a5acca 100644
--- a/drivers/net/sonic.c
+++ b/drivers/net/sonic.c
@@ -295,15 +295,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
295 */ 295 */
296static irqreturn_t sonic_interrupt(int irq, void *dev_id) 296static irqreturn_t sonic_interrupt(int irq, void *dev_id)
297{ 297{
298 struct net_device *dev = (struct net_device *) dev_id; 298 struct net_device *dev = dev_id;
299 struct sonic_local *lp = netdev_priv(dev); 299 struct sonic_local *lp = netdev_priv(dev);
300 int status; 300 int status;
301 301
302 if (dev == NULL) {
303 printk(KERN_ERR "sonic_interrupt: irq %d for unknown device.\n", irq);
304 return IRQ_NONE;
305 }
306
307 if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)) 302 if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT))
308 return IRQ_NONE; 303 return IRQ_NONE;
309 304
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 45d07faf7b96..9d7cd130c19d 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2095,8 +2095,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
2095 2095
2096static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) 2096static irqreturn_t happy_meal_interrupt(int irq, void *dev_id)
2097{ 2097{
2098 struct net_device *dev = (struct net_device *) dev_id; 2098 struct net_device *dev = dev_id;
2099 struct happy_meal *hp = dev->priv; 2099 struct happy_meal *hp = netdev_priv(dev);
2100 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); 2100 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
2101 2101
2102 HMD(("happy_meal_interrupt: status=%08x ", happy_status)); 2102 HMD(("happy_meal_interrupt: status=%08x ", happy_status));
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 9207e19cac34..5b00d79b5573 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -822,7 +822,7 @@ out:
822 822
823static irqreturn_t lance_interrupt(int irq, void *dev_id) 823static irqreturn_t lance_interrupt(int irq, void *dev_id)
824{ 824{
825 struct net_device *dev = (struct net_device *)dev_id; 825 struct net_device *dev = dev_id;
826 struct lance_private *lp = netdev_priv(dev); 826 struct lance_private *lp = netdev_priv(dev);
827 int csr0; 827 int csr0;
828 828
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 020e78170595..7874eb1ef043 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -468,7 +468,7 @@ static void qe_tx_reclaim(struct sunqe *qep);
468 */ 468 */
469static irqreturn_t qec_interrupt(int irq, void *dev_id) 469static irqreturn_t qec_interrupt(int irq, void *dev_id)
470{ 470{
471 struct sunqec *qecp = (struct sunqec *) dev_id; 471 struct sunqec *qecp = dev_id;
472 u32 qec_status; 472 u32 qec_status;
473 int channel = 0; 473 int channel = 0;
474 474
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 9bd4cba87872..46dabdb12071 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -1990,15 +1990,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
1990 __u8 isb_type, isb_subtype; 1990 __u8 isb_type, isb_subtype;
1991 __u16 isb_index; 1991 __u16 isb_index;
1992 1992
1993 if(dev == NULL)
1994 {
1995 printk(KERN_CRIT "%s: irq %d for unknown device.\n", dev->name, irq);
1996 return IRQ_NONE;
1997 }
1998
1999 ioaddr = dev->base_addr; 1993 ioaddr = dev->base_addr;
2000 tp = netdev_priv(dev); 1994 tp = netdev_priv(dev);
2001
2002 1995
2003 if(tp->status == NOT_INITIALIZED) 1996 if(tp->status == NOT_INITIALIZED)
2004 return IRQ_NONE; 1997 return IRQ_NONE;
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index c0ab6e44eb1f..ea797ca2b988 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -751,11 +751,6 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
751 unsigned short irq_type; 751 unsigned short irq_type;
752 int handled = 0; 752 int handled = 0;
753 753
754 if(dev == NULL) {
755 printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq);
756 return IRQ_NONE;
757 }
758
759 tp = netdev_priv(dev); 754 tp = netdev_priv(dev);
760 755
761 irq_type = SIFREADW(SIFSTS); 756 irq_type = SIFREADW(SIFSTS);
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index e17f9779ead2..3f4b6408b755 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1540,16 +1540,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
1540static irqreturn_t 1540static irqreturn_t
1541de4x5_interrupt(int irq, void *dev_id) 1541de4x5_interrupt(int irq, void *dev_id)
1542{ 1542{
1543 struct net_device *dev = (struct net_device *)dev_id; 1543 struct net_device *dev = dev_id;
1544 struct de4x5_private *lp; 1544 struct de4x5_private *lp;
1545 s32 imr, omr, sts, limit; 1545 s32 imr, omr, sts, limit;
1546 u_long iobase; 1546 u_long iobase;
1547 unsigned int handled = 0; 1547 unsigned int handled = 0;
1548 1548
1549 if (dev == NULL) {
1550 printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq);
1551 return IRQ_NONE;
1552 }
1553 lp = netdev_priv(dev); 1549 lp = netdev_priv(dev);
1554 spin_lock(&lp->lock); 1550 spin_lock(&lp->lock);
1555 iobase = dev->base_addr; 1551 iobase = dev->base_addr;
diff --git a/drivers/net/wan/cycx_main.c b/drivers/net/wan/cycx_main.c
index 12363e056b63..6e5f1c898517 100644
--- a/drivers/net/wan/cycx_main.c
+++ b/drivers/net/wan/cycx_main.c
@@ -303,9 +303,9 @@ out: return ret;
303 */ 303 */
304static irqreturn_t cycx_isr(int irq, void *dev_id) 304static irqreturn_t cycx_isr(int irq, void *dev_id)
305{ 305{
306 struct cycx_device *card = (struct cycx_device *)dev_id; 306 struct cycx_device *card = dev_id;
307 307
308 if (!card || card->wandev.state == WAN_UNCONFIGURED) 308 if (card->wandev.state == WAN_UNCONFIGURED)
309 goto out; 309 goto out;
310 310
311 if (card->in_isr) { 311 if (card->in_isr) {
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 5715d25271f1..6a485f0556f4 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -875,13 +875,7 @@ static irqreturn_t sdla_isr(int irq, void *dev_id)
875 875
876 dev = dev_id; 876 dev = dev_id;
877 877
878 if (dev == NULL) 878 flp = netdev_priv(dev);
879 {
880 printk(KERN_WARNING "sdla_isr(): irq %d for unknown device.\n", irq);
881 return IRQ_NONE;
882 }
883
884 flp = dev->priv;
885 879
886 if (!flp->initialized) 880 if (!flp->initialized)
887 { 881 {
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 793da5f69344..b779c7dcc1a8 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1954,7 +1954,7 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
1954 1954
1955irqreturn_t orinoco_interrupt(int irq, void *dev_id) 1955irqreturn_t orinoco_interrupt(int irq, void *dev_id)
1956{ 1956{
1957 struct net_device *dev = (struct net_device *)dev_id; 1957 struct net_device *dev = dev_id;
1958 struct orinoco_private *priv = netdev_priv(dev); 1958 struct orinoco_private *priv = netdev_priv(dev);
1959 hermes_t *hw = &priv->hw; 1959 hermes_t *hw = &priv->hw;
1960 int count = MAX_IRQLOOPS_PER_IRQ; 1960 int count = MAX_IRQLOOPS_PER_IRQ;
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index cadfe132db84..aafb301041b1 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -4119,21 +4119,12 @@ static irqreturn_t
4119wavelan_interrupt(int irq, 4119wavelan_interrupt(int irq,
4120 void * dev_id) 4120 void * dev_id)
4121{ 4121{
4122 struct net_device * dev; 4122 struct net_device * dev = dev_id;
4123 net_local * lp; 4123 net_local * lp;
4124 kio_addr_t base; 4124 kio_addr_t base;
4125 int status0; 4125 int status0;
4126 u_int tx_status; 4126 u_int tx_status;
4127 4127
4128 if ((dev = dev_id) == NULL)
4129 {
4130#ifdef DEBUG_INTERRUPT_ERROR
4131 printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
4132 irq);
4133#endif
4134 return IRQ_NONE;
4135 }
4136
4137#ifdef DEBUG_INTERRUPT_TRACE 4128#ifdef DEBUG_INTERRUPT_TRACE
4138 printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); 4129 printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
4139#endif 4130#endif
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index a1430352169b..5b98a7876982 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this)
1155 */ 1155 */
1156static irqreturn_t wl3501_interrupt(int irq, void *dev_id) 1156static irqreturn_t wl3501_interrupt(int irq, void *dev_id)
1157{ 1157{
1158 struct net_device *dev = (struct net_device *)dev_id; 1158 struct net_device *dev = dev_id;
1159 struct wl3501_card *this; 1159 struct wl3501_card *this;
1160 int handled = 1;
1161 1160
1162 if (!dev) 1161 this = netdev_priv(dev);
1163 goto unknown;
1164 this = dev->priv;
1165 spin_lock(&this->lock); 1162 spin_lock(&this->lock);
1166 wl3501_ack_interrupt(this); 1163 wl3501_ack_interrupt(this);
1167 wl3501_block_interrupt(this); 1164 wl3501_block_interrupt(this);
1168 wl3501_rx_interrupt(dev); 1165 wl3501_rx_interrupt(dev);
1169 wl3501_unblock_interrupt(this); 1166 wl3501_unblock_interrupt(this);
1170 spin_unlock(&this->lock); 1167 spin_unlock(&this->lock);
1171out: 1168
1172 return IRQ_RETVAL(handled); 1169 return IRQ_HANDLED;
1173unknown:
1174 handled = 0;
1175 printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq);
1176 goto out;
1177} 1170}
1178 1171
1179static int wl3501_reset_board(struct wl3501_card *this) 1172static int wl3501_reset_board(struct wl3501_card *this)
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index ac600212d9a9..2412ce4917f2 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -896,13 +896,6 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance)
896 int boguscnt = max_interrupt_work; 896 int boguscnt = max_interrupt_work;
897 unsigned int handled = 0; 897 unsigned int handled = 0;
898 898
899#ifndef final_version /* Can never occur. */
900 if (dev == NULL) {
901 printk (KERN_ERR "yellowfin_interrupt(): irq %d for unknown device.\n", irq);
902 return IRQ_NONE;
903 }
904#endif
905
906 yp = netdev_priv(dev); 899 yp = netdev_priv(dev);
907 ioaddr = yp->base; 900 ioaddr = yp->base;
908 901
diff --git a/drivers/net/znet.c b/drivers/net/znet.c
index 2068a109a86c..b24b0727108c 100644
--- a/drivers/net/znet.c
+++ b/drivers/net/znet.c
@@ -610,11 +610,6 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id)
610 int boguscnt = 20; 610 int boguscnt = 20;
611 int handled = 0; 611 int handled = 0;
612 612
613 if (dev == NULL) {
614 printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq);
615 return IRQ_NONE;
616 }
617
618 spin_lock (&znet->lock); 613 spin_lock (&znet->lock);
619 614
620 ioaddr = dev->base_addr; 615 ioaddr = dev->base_addr;