1
0
Fork 0

[netdrvr] irq handler minor cleanups in several drivers

* use irq_handler_t where appropriate

* no need to use 'irq' function arg, its already stored in a data struct

* rename irq handler 'irq' argument to 'dummy', where the function
  has been analyzed and proven not to use its first argument.

* remove always-false "dev_id == NULL" test from irq handlers

* remove pointless casts from void*

* declance: irq argument is not const

* add KERN_xxx printk prefix

* fix minor whitespace weirdness

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
wifi-calibration
Jeff Garzik 2007-10-29 05:46:16 -04:00 committed by David S. Miller
parent 1b36efe07f
commit 28fc1f5a0c
19 changed files with 40 additions and 74 deletions

View File

@ -497,11 +497,6 @@ simeth_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
if ( dev == NULL ) {
printk(KERN_WARNING "simeth: irq %d for unknown device\n", irq);
return IRQ_NONE;
}
/*
* very simple loop because we get interrupts only when receiving
*/

View File

@ -272,7 +272,7 @@ scc_enet_timeout(struct net_device *dev)
* This is called from the CPM handler, not the MPC core interrupt.
*/
static irqreturn_t
scc_enet_interrupt(int irq, void * dev_id)
scc_enet_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
volatile struct scc_enet_private *cep;
@ -280,7 +280,7 @@ scc_enet_interrupt(int irq, void * dev_id)
ushort int_events;
int must_restart;
cep = (struct scc_enet_private *)dev->priv;
cep = dev->priv;
/* Get the interrupt events that caused us to be here.
*/

View File

@ -524,7 +524,7 @@ fcc_enet_timeout(struct net_device *dev)
/* The interrupt handler. */
static irqreturn_t
fcc_enet_interrupt(int irq, void * dev_id)
fcc_enet_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
volatile struct fcc_enet_private *cep;
@ -532,7 +532,7 @@ fcc_enet_interrupt(int irq, void * dev_id)
ushort int_events;
int must_restart;
cep = (struct fcc_enet_private *)dev->priv;
cep = dev->priv;
/* Get the interrupt events that caused us to be here.
*/

View File

@ -661,9 +661,6 @@ static irqreturn_t cpmac_irq(int irq, void *dev_id)
int queue;
u32 status;
if (!dev)
return IRQ_NONE;
priv = netdev_priv(dev);
status = cpmac_read(priv->regs, CPMAC_MAC_INT_VECTOR);

View File

@ -719,15 +719,15 @@ out:
spin_unlock(&lp->lock);
}
static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
static irqreturn_t lance_dma_merr_int(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
printk("%s: DMA error\n", dev->name);
printk(KERN_ERR "%s: DMA error\n", dev->name);
return IRQ_HANDLED;
}
static irqreturn_t lance_interrupt(const int irq, void *dev_id)
static irqreturn_t lance_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
struct lance_private *lp = netdev_priv(dev);

View File

@ -456,8 +456,9 @@ static int eexp_open(struct net_device *dev)
if (!dev->irq || !irqrmap[dev->irq])
return -ENXIO;
ret = request_irq(dev->irq,&eexp_irq,0,dev->name,dev);
if (ret) return ret;
ret = request_irq(dev->irq, &eexp_irq, 0, dev->name, dev);
if (ret)
return ret;
if (!request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress")) {
printk(KERN_WARNING "EtherExpress io port %x, is busy.\n"
@ -768,7 +769,7 @@ static void eexp_cmd_clear(struct net_device *dev)
}
}
static irqreturn_t eexp_irq(int irq, void *dev_info)
static irqreturn_t eexp_irq(int dummy, void *dev_info)
{
struct net_device *dev = dev_info;
struct net_local *lp;
@ -783,7 +784,7 @@ static irqreturn_t eexp_irq(int irq, void *dev_info)
old_read_ptr = inw(ioaddr+READ_PTR);
old_write_ptr = inw(ioaddr+WRITE_PTR);
outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ);
outb(SIRQ_dis|irqrmap[dev->irq],ioaddr+SET_IRQ);
status = scb_status(dev);
@ -851,7 +852,7 @@ static irqreturn_t eexp_irq(int irq, void *dev_info)
eexp_cmd_clear(dev);
outb(SIRQ_en|irqrmap[irq],ioaddr+SET_IRQ);
outb(SIRQ_en|irqrmap[dev->irq],ioaddr+SET_IRQ);
#if NET_DEBUG > 6
printk("%s: leaving eexp_irq()\n", dev->name);

View File

@ -704,9 +704,9 @@ static void irqtxerr_handler(struct net_device *dev)
/* general interrupt entry */
static irqreturn_t irq_handler(int irq, void *device)
static irqreturn_t irq_handler(int dummy, void *device)
{
struct net_device *dev = (struct net_device *) device;
struct net_device *dev = device;
u16 ival;
/* in case we're not meant... */

View File

@ -74,7 +74,7 @@ struct irport_cb {
/* For piggyback drivers */
void *priv;
void (*change_speed)(void *priv, __u32 speed);
irqreturn_t (*interrupt)(int irq, void *dev_id);
irq_handler_t interrupt;
};
#endif /* IRPORT_H */

View File

@ -1505,22 +1505,13 @@ static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self)
* An interrupt from the chip has arrived. Time to do some work
*
*/
static irqreturn_t smsc_ircc_interrupt(int irq, void *dev_id)
static irqreturn_t smsc_ircc_interrupt(int dummy, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
struct smsc_ircc_cb *self;
struct net_device *dev = dev_id;
struct smsc_ircc_cb *self = netdev_priv(dev);
int iobase, iir, lcra, lsr;
irqreturn_t ret = IRQ_NONE;
if (dev == NULL) {
printk(KERN_WARNING "%s: irq %d for unknown device.\n",
driver_name, irq);
goto irq_ret;
}
self = netdev_priv(dev);
IRDA_ASSERT(self != NULL, return IRQ_NONE;);
/* Serialise the interrupt handler in various CPUs, stop Tx path */
spin_lock(&self->lock);
@ -1565,7 +1556,7 @@ static irqreturn_t smsc_ircc_interrupt(int irq, void *dev_id)
irq_ret_unlock:
spin_unlock(&self->lock);
irq_ret:
return ret;
}

View File

@ -1346,19 +1346,13 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
* An interrupt from the chip has arrived. Time to do some work
*
*/
static irqreturn_t via_ircc_interrupt(int irq, void *dev_id)
static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
struct via_ircc_cb *self;
struct net_device *dev = dev_id;
struct via_ircc_cb *self = dev->priv;
int iobase;
u8 iHostIntType, iRxIntType, iTxIntType;
if (!dev) {
IRDA_WARNING("%s: irq %d for unknown device.\n", driver_name,
irq);
return IRQ_NONE;
}
self = (struct via_ircc_cb *) dev->priv;
iobase = self->io.fir_base;
spin_lock(&self->lock);
iHostIntType = GetHostStatus(iobase);

View File

@ -734,7 +734,7 @@ static int ixgbe_request_irq(struct ixgbe_adapter *adapter, u32 *num_rx_queues)
{
struct net_device *netdev = adapter->netdev;
int flags, err;
irqreturn_t(*handler) (int, void *) = &ixgbe_intr;
irq_handler_t handler = ixgbe_intr;
flags = IRQF_SHARED;

View File

@ -1144,14 +1144,13 @@ i596_handle_CU_completion(struct net_device *dev,
}
static irqreturn_t
i596_interrupt (int irq, void *dev_instance) {
struct net_device *dev = (struct net_device *) dev_instance;
struct i596_private *lp;
i596_interrupt (int irq, void *dev_instance)
{
struct net_device *dev = dev_instance;
struct i596_private *lp = dev->priv;
unsigned short status, ack_cmd = 0;
int frames_in = 0;
lp = (struct i596_private *) dev->priv;
/*
* The 82596 examines the command, performs the required action,
* and then clears the SCB command word.

View File

@ -731,18 +731,13 @@ module_exit(exit_fmvj18x_cs);
/*====================================================================*/
static irqreturn_t fjn_interrupt(int irq, void *dev_id)
static irqreturn_t fjn_interrupt(int dummy, void *dev_id)
{
struct net_device *dev = dev_id;
local_info_t *lp = netdev_priv(dev);
kio_addr_t ioaddr;
unsigned short tx_stat, rx_stat;
if (lp == NULL) {
printk(KERN_NOTICE "fjn_interrupt(): irq %d for "
"unknown device.\n", irq);
return IRQ_NONE;
}
ioaddr = dev->base_addr;
/* avoid multiple interrupts */

View File

@ -3614,9 +3614,6 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
ugeth_vdbg("%s: IN", __FUNCTION__);
if (!ugeth)
return IRQ_NONE;
uccf = ugeth->uccf;
ug_info = ugeth->ug_info;

View File

@ -1498,9 +1498,9 @@ do_bottom_half_rx(struct fst_card_info *card)
* Dev_id is our fst_card_info pointer
*/
static irqreturn_t
fst_intr(int irq, void *dev_id)
fst_intr(int dummy, void *dev_id)
{
struct fst_card_info *card;
struct fst_card_info *card = dev_id;
struct fst_port_info *port;
int rdidx; /* Event buffer indices */
int wridx;
@ -1509,17 +1509,12 @@ fst_intr(int irq, void *dev_id)
unsigned int do_card_interrupt;
unsigned int int_retry_count;
if ((card = dev_id) == NULL) {
dbg(DBG_INTR, "intr: spurious %d\n", irq);
return IRQ_NONE;
}
/*
* Check to see if the interrupt was for this card
* return if not
* Note that the call to clear the interrupt is important
*/
dbg(DBG_INTR, "intr: %d %p\n", irq, card);
dbg(DBG_INTR, "intr: %d %p\n", card->irq, card);
if (card->state != FST_RUNNING) {
printk_err
("Interrupt received for card %d in a non running state (%d)\n",

View File

@ -867,7 +867,7 @@ static void sdla_receive(struct net_device *dev)
spin_unlock_irqrestore(&sdla_lock, flags);
}
static irqreturn_t sdla_isr(int irq, void *dev_id)
static irqreturn_t sdla_isr(int dummy, void *dev_id)
{
struct net_device *dev;
struct frad_local *flp;
@ -879,7 +879,8 @@ static irqreturn_t sdla_isr(int irq, void *dev_id)
if (!flp->initialized)
{
printk(KERN_WARNING "%s: irq %d for uninitialized device.\n", dev->name, irq);
printk(KERN_WARNING "%s: irq %d for uninitialized device.\n",
dev->name, dev->irq);
return IRQ_NONE;
}

View File

@ -3177,8 +3177,9 @@ static int airo_thread(void *data) {
return 0;
}
static irqreturn_t airo_interrupt ( int irq, void* dev_id) {
struct net_device *dev = (struct net_device *)dev_id;
static irqreturn_t airo_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
u16 status;
u16 fid;
struct airo_info *apriv = dev->priv;

View File

@ -2624,7 +2624,7 @@ static void prism2_check_magic(local_info_t *local)
/* Called only from hardware IRQ */
static irqreturn_t prism2_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
struct net_device *dev = dev_id;
struct hostap_interface *iface;
local_info_t *local;
int events = 0;

View File

@ -243,7 +243,7 @@ static inline void if_cs_disable_ints(struct if_cs_card *card)
static irqreturn_t if_cs_interrupt(int irq, void *data)
{
struct if_cs_card *card = (struct if_cs_card *)data;
struct if_cs_card *card = data;
u16 int_cause;
lbs_deb_enter(LBS_DEB_CS);