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>
This commit is contained in:
Jeff Garzik
2006-10-06 14:56:04 -04:00
parent 86d91bab48
commit c31f28e778
37 changed files with 39 additions and 199 deletions

View File

@@ -1954,7 +1954,7 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
irqreturn_t orinoco_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct net_device *dev = dev_id;
struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
int count = MAX_IRQLOOPS_PER_IRQ;

View File

@@ -4119,21 +4119,12 @@ static irqreturn_t
wavelan_interrupt(int irq,
void * dev_id)
{
struct net_device * dev;
struct net_device * dev = dev_id;
net_local * lp;
kio_addr_t base;
int status0;
u_int tx_status;
if ((dev = dev_id) == NULL)
{
#ifdef DEBUG_INTERRUPT_ERROR
printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
irq);
#endif
return IRQ_NONE;
}
#ifdef DEBUG_INTERRUPT_TRACE
printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
#endif

View File

@@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this)
*/
static irqreturn_t wl3501_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct net_device *dev = dev_id;
struct wl3501_card *this;
int handled = 1;
if (!dev)
goto unknown;
this = dev->priv;
this = netdev_priv(dev);
spin_lock(&this->lock);
wl3501_ack_interrupt(this);
wl3501_block_interrupt(this);
wl3501_rx_interrupt(dev);
wl3501_unblock_interrupt(this);
spin_unlock(&this->lock);
out:
return IRQ_RETVAL(handled);
unknown:
handled = 0;
printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq);
goto out;
return IRQ_HANDLED;
}
static int wl3501_reset_board(struct wl3501_card *this)