diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-10-06 15:00:58 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-10-06 15:00:58 -0400 |
commit | c7bec5aba52392aa8d675b8722735caf4a8b7265 (patch) | |
tree | 8087cfd2866e63fba25e18ba1fa0f374c27be4f0 /drivers/atm | |
parent | c31f28e778ab299a5035ea2bda64f245b8915d7c (diff) |
Various drivers' irq handlers: kill dead code, needless casts
- Eliminate casts to/from void*
- Eliminate checks for conditions that never occur. These typically
fall into two classes:
1) Checking for 'dev_id == NULL', then it is never called with
NULL as an argument.
2) Checking for invalid irq number, when the only caller (the
system) guarantees the irq handler is called with the proper
'irq' number argument.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/ambassador.c | 7 | ||||
-rw-r--r-- | drivers/atm/horizon.c | 9 | ||||
-rw-r--r-- | drivers/atm/lanai.c | 4 |
3 files changed, 2 insertions, 18 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index 8ff5c4e50823..323592de047b 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c | |||
@@ -862,15 +862,10 @@ static inline void interrupts_off (amb_dev * dev) { | |||
862 | /********** interrupt handling **********/ | 862 | /********** interrupt handling **********/ |
863 | 863 | ||
864 | static irqreturn_t interrupt_handler(int irq, void *dev_id) { | 864 | static irqreturn_t interrupt_handler(int irq, void *dev_id) { |
865 | amb_dev * dev = (amb_dev *) dev_id; | 865 | amb_dev * dev = dev_id; |
866 | 866 | ||
867 | PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id); | 867 | PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id); |
868 | 868 | ||
869 | if (!dev_id) { | ||
870 | PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); | ||
871 | return IRQ_NONE; | ||
872 | } | ||
873 | |||
874 | { | 869 | { |
875 | u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt)); | 870 | u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt)); |
876 | 871 | ||
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 33e9ee47392b..f59349206dd2 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c | |||
@@ -1389,15 +1389,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id) { | |||
1389 | 1389 | ||
1390 | PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id); | 1390 | PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id); |
1391 | 1391 | ||
1392 | if (!dev_id) { | ||
1393 | PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); | ||
1394 | return IRQ_NONE; | ||
1395 | } | ||
1396 | if (irq != dev->irq) { | ||
1397 | PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); | ||
1398 | return IRQ_NONE; | ||
1399 | } | ||
1400 | |||
1401 | // definitely for us | 1392 | // definitely for us |
1402 | irq_ok = 0; | 1393 | irq_ok = 0; |
1403 | while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF) | 1394 | while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF) |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 8895f026bea7..267825501dfe 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -1892,11 +1892,9 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason) | |||
1892 | 1892 | ||
1893 | static irqreturn_t lanai_int(int irq, void *devid) | 1893 | static irqreturn_t lanai_int(int irq, void *devid) |
1894 | { | 1894 | { |
1895 | struct lanai_dev *lanai = (struct lanai_dev *) devid; | 1895 | struct lanai_dev *lanai = devid; |
1896 | u32 reason; | 1896 | u32 reason; |
1897 | 1897 | ||
1898 | (void) irq; /* unused variables */ | ||
1899 | |||
1900 | #ifdef USE_POWERDOWN | 1898 | #ifdef USE_POWERDOWN |
1901 | /* | 1899 | /* |
1902 | * If we're powered down we shouldn't be generating any interrupts - | 1900 | * If we're powered down we shouldn't be generating any interrupts - |