Cosmetic in saa7146_core::interrupt_hw() - removal of Yoda-style tests against the zero value; - removal of unneeded initialization; - shortens expressions through use of local variable; - adds a few missing whitespace Signed-off-by: Francois Romieu <romieu@xxxxxxxxxxxxx> diff -puN drivers/media/common/saa7146_core.c~dvb-130 drivers/media/common/saa7146_core.c --- a/drivers/media/common/saa7146_core.c~dvb-130 2005-05-20 00:54:02.000000000 +0200 +++ b/drivers/media/common/saa7146_core.c 2005-05-20 19:21:38.161327348 +0200 @@ -234,46 +234,43 @@ int saa7146_pgtable_build_single(struct static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs) { struct saa7146_dev *dev = dev_id; - u32 isr = 0; + struct saa7146_extension *ext = dev->ext; + u32 isr; /* read out the interrupt status register */ isr = saa7146_read(dev, ISR); /* is this our interrupt? */ - if ( 0 == isr ) { + if (isr) { /* nope, some other device */ return IRQ_NONE; } saa7146_write(dev, ISR, isr); - if( 0 != (dev->ext)) { - if( 0 != (dev->ext->irq_mask & isr )) { - if( 0 != dev->ext->irq_func ) { - dev->ext->irq_func(dev, &isr); - } - isr &= ~dev->ext->irq_mask; - } + if (ext && (ext->irq_mask & isr)) { + if (ext->irq_func) + ext->irq_func(dev, &isr); + isr &= ~ext->irq_mask; } - if (0 != (isr & (MASK_27))) { + if (isr & MASK_27) { DEB_INT(("irq: RPS0 (0x%08x).\n",isr)); - if( 0 != dev->vv_data && 0 != dev->vv_callback) { - dev->vv_callback(dev,isr); - } + if (dev->vv_data && dev->vv_callback) + dev->vv_callback(dev, isr); isr &= ~MASK_27; } - if (0 != (isr & (MASK_28))) { - if( 0 != dev->vv_data && 0 != dev->vv_callback) { - dev->vv_callback(dev,isr); - } + if (isr & MASK_28) { + if (dev->vv_data && dev->vv_callback) + dev->vv_callback(dev, isr); isr &= ~MASK_28; } - if (0 != (isr & (MASK_16|MASK_17))) { + if (isr & (MASK_16 | MASK_17)) { u32 status = saa7146_read(dev, I2C_STATUS); - if( (0x3 == (status & 0x3)) || (0 == (status & 0x1)) ) { - SAA7146_IER_DISABLE(dev, MASK_16|MASK_17); + + if ((0x3 == (status & 0x3)) || (0 == (status & 0x1))) { + SAA7146_IER_DISABLE(dev, MASK_16 | MASK_17); /* only wake up if we expect something */ - if( 0 != dev->i2c_op ) { + if (dev->i2c_op) { u32 psr = (saa7146_read(dev, PSR) >> 16) & 0x2; u32 ssr = (saa7146_read(dev, SSR) >> 17) & 0x1f; DEB_I2C(("irq: i2c, status: 0x%08x, psr:0x%02x, ssr:0x%02x).\n",status,psr,ssr)); @@ -285,12 +282,12 @@ static irqreturn_t interrupt_hw(int irq, } else { DEB_I2C(("unhandled irq: i2c, status: 0x%08x, isr %#x\n",status, isr)); } - isr &= ~(MASK_16|MASK_17); + isr &= ~(MASK_16 | MASK_17); } - if( 0 != isr ) { + if (isr) { ERR(("warning: interrupt enabled, but not handled properly.(0x%08x)\n",isr)); ERR(("disabling interrupt source(s)!\n")); - SAA7146_IER_DISABLE(dev,isr); + SAA7146_IER_DISABLE(dev, isr); } return IRQ_HANDLED; } _