mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]>
This commit is contained in:
parent
c31f28e778
commit
c7bec5aba5
35 changed files with 59 additions and 98 deletions
|
|
@ -862,15 +862,10 @@ static inline void interrupts_off (amb_dev * dev) {
|
|||
/********** interrupt handling **********/
|
||||
|
||||
static irqreturn_t interrupt_handler(int irq, void *dev_id) {
|
||||
amb_dev * dev = (amb_dev *) dev_id;
|
||||
amb_dev * dev = dev_id;
|
||||
|
||||
PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id);
|
||||
|
||||
if (!dev_id) {
|
||||
PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
{
|
||||
u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt));
|
||||
|
||||
|
|
|
|||
|
|
@ -1389,15 +1389,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id) {
|
|||
|
||||
PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id);
|
||||
|
||||
if (!dev_id) {
|
||||
PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
|
||||
return IRQ_NONE;
|
||||
}
|
||||
if (irq != dev->irq) {
|
||||
PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq);
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
// definitely for us
|
||||
irq_ok = 0;
|
||||
while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF)
|
||||
|
|
|
|||
|
|
@ -1892,11 +1892,9 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason)
|
|||
|
||||
static irqreturn_t lanai_int(int irq, void *devid)
|
||||
{
|
||||
struct lanai_dev *lanai = (struct lanai_dev *) devid;
|
||||
struct lanai_dev *lanai = devid;
|
||||
u32 reason;
|
||||
|
||||
(void) irq; /* unused variables */
|
||||
|
||||
#ifdef USE_POWERDOWN
|
||||
/*
|
||||
* If we're powered down we shouldn't be generating any interrupts -
|
||||
|
|
|
|||
Loading…
Reference in a new issue