aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda
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 /drivers/net/irda
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>
Diffstat (limited to 'drivers/net/irda')
-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
6 files changed, 10 insertions, 39 deletions
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