“4f50d2fd00da451261f51f28e929ebd161068422”上不存在“sound/git@gitcode.net:openeuler/raspberrypi-kernel.git”
提交 c31f28e7 编写于 作者: J Jeff Garzik

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: NJeff Garzik <jeff@garzik.org>
上级 86d91bab
...@@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
static irqreturn_t static irqreturn_t
el3_interrupt(int irq, void *dev_id) el3_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = dev_id;
struct el3_private *lp; struct el3_private *lp;
int ioaddr, status; int ioaddr, status;
int i = max_interrupt_work; int i = max_interrupt_work;
if (dev == NULL) {
printk ("el3_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
lp = netdev_priv(dev); lp = netdev_priv(dev);
spin_lock(&lp->lock); spin_lock(&lp->lock);
......
...@@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr) ...@@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr)
static irqreturn_t static irqreturn_t
elmc_interrupt(int irq, void *dev_id) elmc_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
unsigned short stat; unsigned short stat;
struct priv *p; struct priv *p;
if (dev == NULL) { if (!netif_running(dev)) {
printk(KERN_ERR "elmc-interrupt: irq %d for unknown device.\n", irq);
return IRQ_NONE;
} else if (!netif_running(dev)) {
/* The 3c523 has this habit of generating interrupts during the /* The 3c523 has this habit of generating interrupts during the
reset. I'm not sure if the ni52 has this same problem, but it's reset. I'm not sure if the ni52 has this same problem, but it's
really annoying if we haven't finished initializing it. I was really annoying if we haven't finished initializing it. I was
......
...@@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id) ...@@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id)
int rx_event = 0; int rx_event = 0;
int tx_event = 0; int tx_event = 0;
if (dev == NULL) {
printk(KERN_WARNING "%s: irq %d for unknown device.\n", cardname, irq);
return IRQ_NONE;
}
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
lp = netdev_priv(dev); lp = netdev_priv(dev);
......
...@@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id) ...@@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id)
int interrupts, nr_serviced = 0; int interrupts, nr_serviced = 0;
struct ei_device *ei_local; struct ei_device *ei_local;
if (dev == NULL)
{
printk ("net_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
e8390_base = dev->base_addr; e8390_base = dev->base_addr;
ei_local = (struct ei_device *) netdev_priv(dev); ei_local = netdev_priv(dev);
/* /*
* Protect the irq test too. * Protect the irq test too.
......
...@@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
Handle the network interface interrupts. */ Handle the network interface interrupts. */
static irqreturn_t atp_interrupt(int irq, void *dev_instance) static irqreturn_t atp_interrupt(int irq, void *dev_instance)
{ {
struct net_device *dev = (struct net_device *)dev_instance; struct net_device *dev = dev_instance;
struct net_local *lp; struct net_local *lp;
long ioaddr; long ioaddr;
static int num_tx_since_rx; static int num_tx_since_rx;
int boguscount = max_interrupt_work; int boguscount = max_interrupt_work;
int handled = 0; int handled = 0;
if (dev == NULL) {
printk(KERN_ERR "ATP_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
lp = netdev_priv(dev); lp = netdev_priv(dev);
......
...@@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id) ...@@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id)
int retrig = 0; int retrig = 0;
int boguscount = 0; int boguscount = 0;
/* This might just as well be deleted now, no crummy drivers present :-) */
if ((dev == NULL) || (DE600_IRQ != irq)) {
printk(KERN_ERR "%s: bogus interrupt %d\n", dev?dev->name:"DE-600", irq);
return IRQ_NONE;
}
spin_lock(&de600_lock); spin_lock(&de600_lock);
select_nic(); select_nic();
......
...@@ -696,7 +696,7 @@ static void lance_tx(struct net_device *dev) ...@@ -696,7 +696,7 @@ static void lance_tx(struct net_device *dev)
static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
printk("%s: DMA error\n", dev->name); printk("%s: DMA error\n", dev->name);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -704,7 +704,7 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) ...@@ -704,7 +704,7 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
static irqreturn_t lance_interrupt(const int irq, void *dev_id) static irqreturn_t lance_interrupt(const int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
volatile struct lance_regs *ll = lp->ll; volatile struct lance_regs *ll = lp->ll;
int csr0; int csr0;
......
...@@ -897,8 +897,8 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd) ...@@ -897,8 +897,8 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd)
static irqreturn_t dgrs_intr(int irq, void *dev_id) static irqreturn_t dgrs_intr(int irq, void *dev_id)
{ {
struct net_device *dev0 = (struct net_device *) dev_id; struct net_device *dev0 = dev_id;
DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv; DGRS_PRIV *priv0 = dev0->priv;
I596_CB *cbp; I596_CB *cbp;
int cmd; int cmd;
int i; int i;
......
...@@ -1198,17 +1198,11 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -1198,17 +1198,11 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
static irqreturn_t static irqreturn_t
eepro_interrupt(int irq, void *dev_id) eepro_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = dev_id;
/* (struct net_device *)(irq2dev_map[irq]);*/
struct eepro_local *lp; struct eepro_local *lp;
int ioaddr, status, boguscount = 20; int ioaddr, status, boguscount = 20;
int handled = 0; int handled = 0;
if (dev == NULL) {
printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq);
return IRQ_NONE;
}
lp = netdev_priv(dev); lp = netdev_priv(dev);
spin_lock(&lp->lock); spin_lock(&lp->lock);
......
...@@ -796,13 +796,6 @@ static irqreturn_t eexp_irq(int irq, void *dev_info) ...@@ -796,13 +796,6 @@ static irqreturn_t eexp_irq(int irq, void *dev_info)
unsigned short ioaddr,status,ack_cmd; unsigned short ioaddr,status,ack_cmd;
unsigned short old_read_ptr, old_write_ptr; unsigned short old_read_ptr, old_write_ptr;
if (dev==NULL)
{
printk(KERN_WARNING "eexpress: irq %d for unknown device\n",
irq);
return IRQ_NONE;
}
lp = netdev_priv(dev); lp = netdev_priv(dev);
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
......
...@@ -662,19 +662,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info) ...@@ -662,19 +662,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info)
*/ */
static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct ali_ircc_cb *self; struct ali_ircc_cb *self;
int ret; int ret;
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
if (!dev) { self = dev->priv;
IRDA_WARNING("%s: irq %d for unknown device.\n",
ALI_IRCC_DRIVER_NAME, irq);
return IRQ_NONE;
}
self = (struct ali_ircc_cb *) dev->priv;
spin_lock(&self->lock); spin_lock(&self->lock);
......
...@@ -657,12 +657,6 @@ toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt) ...@@ -657,12 +657,6 @@ toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt)
return xbofs; return xbofs;
} }
static int toshoboe_invalid_dev(int irq)
{
printk (KERN_WARNING DRIVER_NAME ": irq %d for unknown device.\n", irq);
return 1;
}
#ifdef USE_PROBE #ifdef USE_PROBE
/***********************************************************************/ /***********************************************************************/
/* Probe code */ /* Probe code */
...@@ -711,12 +705,9 @@ stuff_byte (__u8 byte, __u8 * buf) ...@@ -711,12 +705,9 @@ stuff_byte (__u8 byte, __u8 * buf)
static irqreturn_t static irqreturn_t
toshoboe_probeinterrupt (int irq, void *dev_id) toshoboe_probeinterrupt (int irq, void *dev_id)
{ {
struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; struct toshoboe_cb *self = dev_id;
__u8 irqstat; __u8 irqstat;
if (self == NULL && toshoboe_invalid_dev(irq))
return IRQ_NONE;
irqstat = INB (OBOE_ISR); irqstat = INB (OBOE_ISR);
/* was it us */ /* was it us */
......
...@@ -766,18 +766,14 @@ static inline void irport_receive(struct irport_cb *self) ...@@ -766,18 +766,14 @@ static inline void irport_receive(struct irport_cb *self)
*/ */
static irqreturn_t irport_interrupt(int irq, void *dev_id) static irqreturn_t irport_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct irport_cb *self; struct irport_cb *self;
int boguscount = 0; int boguscount = 0;
int iobase; int iobase;
int iir, lsr; int iir, lsr;
int handled = 0; int handled = 0;
if (!dev) { self = dev->priv;
IRDA_WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq);
return IRQ_NONE;
}
self = (struct irport_cb *) dev->priv;
spin_lock(&self->lock); spin_lock(&self->lock);
......
...@@ -74,7 +74,7 @@ struct irport_cb { ...@@ -74,7 +74,7 @@ struct irport_cb {
/* For piggyback drivers */ /* For piggyback drivers */
void *priv; void *priv;
void (*change_speed)(void *priv, __u32 speed); void (*change_speed)(void *priv, __u32 speed);
int (*interrupt)(int irq, void *dev_id); irqreturn_t (*interrupt)(int irq, void *dev_id);
}; };
#endif /* IRPORT_H */ #endif /* IRPORT_H */
...@@ -2068,17 +2068,12 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase, ...@@ -2068,17 +2068,12 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
*/ */
static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id) static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct nsc_ircc_cb *self; struct nsc_ircc_cb *self;
__u8 bsr, eir; __u8 bsr, eir;
int iobase; int iobase;
if (!dev) { self = dev->priv;
IRDA_WARNING("%s: irq %d for unknown device.\n",
driver_name, irq);
return IRQ_NONE;
}
self = (struct nsc_ircc_cb *) dev->priv;
spin_lock(&self->lock); spin_lock(&self->lock);
......
...@@ -1113,17 +1113,12 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr) ...@@ -1113,17 +1113,12 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr)
*/ */
static irqreturn_t w83977af_interrupt(int irq, void *dev_id) static irqreturn_t w83977af_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct w83977af_ir *self; struct w83977af_ir *self;
__u8 set, icr, isr; __u8 set, icr, isr;
int iobase; int iobase;
if (!dev) { self = dev->priv;
printk(KERN_WARNING "%s: irq %d for unknown device.\n",
driver_name, irq);
return IRQ_NONE;
}
self = (struct w83977af_ir *) dev->priv;
iobase = self->io.fir_base; iobase = self->io.fir_base;
......
...@@ -1019,11 +1019,6 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id) ...@@ -1019,11 +1019,6 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id)
int csr0, ioaddr, boguscnt=10; int csr0, ioaddr, boguscnt=10;
int must_restart; int must_restart;
if (dev == NULL) {
printk ("lance_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
lp = dev->priv; lp = dev->priv;
......
...@@ -1201,14 +1201,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) ...@@ -1201,14 +1201,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
struct ei_device *ei_local; struct ei_device *ei_local;
int handled = 0; int handled = 0;
if (dev == NULL)
{
printk ("net_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
e8390_base = dev->base_addr; e8390_base = dev->base_addr;
ei_local = (struct ei_device *) netdev_priv(dev); ei_local = netdev_priv(dev);
/* /*
* Protect the irq test too. * Protect the irq test too.
......
...@@ -2569,13 +2569,6 @@ pcnet32_interrupt(int irq, void *dev_id) ...@@ -2569,13 +2569,6 @@ pcnet32_interrupt(int irq, void *dev_id)
u16 csr0; u16 csr0;
int boguscnt = max_interrupt_work; int boguscnt = max_interrupt_work;
if (!dev) {
if (pcnet32_debug & NETIF_MSG_INTR)
printk(KERN_DEBUG "%s(): irq %d for unknown device\n",
__FUNCTION__, irq);
return IRQ_NONE;
}
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
lp = dev->priv; lp = dev->priv;
......
...@@ -909,11 +909,6 @@ plip_interrupt(int irq, void *dev_id) ...@@ -909,11 +909,6 @@ plip_interrupt(int irq, void *dev_id)
struct plip_local *rcv; struct plip_local *rcv;
unsigned char c0; unsigned char c0;
if (dev == NULL) {
printk(KERN_DEBUG "plip_interrupt: irq %d for unknown device.\n", irq);
return;
}
nl = netdev_priv(dev); nl = netdev_priv(dev);
rcv = &nl->rcv_data; rcv = &nl->rcv_data;
......
...@@ -747,7 +747,7 @@ static int lan_saa9730_rx(struct net_device *dev) ...@@ -747,7 +747,7 @@ static int lan_saa9730_rx(struct net_device *dev)
static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id) static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct lan_saa9730_private *lp = netdev_priv(dev); struct lan_saa9730_private *lp = netdev_priv(dev);
if (lan_saa9730_debug > 5) if (lan_saa9730_debug > 5)
......
...@@ -1084,19 +1084,13 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id) ...@@ -1084,19 +1084,13 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id)
char *name; char *name;
unsigned char st; unsigned char st;
int ioaddr[2]; int ioaddr[2];
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct sb1000_private *lp = netdev_priv(dev); struct sb1000_private *lp = netdev_priv(dev);
const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00};
const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
const int MaxRxErrorCount = 6; const int MaxRxErrorCount = 6;
if (dev == NULL) {
printk(KERN_ERR "sb1000_interrupt(): irq %d for unknown device.\n",
irq);
return IRQ_NONE;
}
ioaddr[0] = dev->base_addr; ioaddr[0] = dev->base_addr;
/* mem_start holds the second I/O address */ /* mem_start holds the second I/O address */
ioaddr[1] = dev->mem_start; ioaddr[1] = dev->mem_start;
......
...@@ -616,15 +616,10 @@ static int skfp_close(struct net_device *dev) ...@@ -616,15 +616,10 @@ static int skfp_close(struct net_device *dev)
irqreturn_t skfp_interrupt(int irq, void *dev_id) irqreturn_t skfp_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct s_smc *smc; /* private board structure pointer */ struct s_smc *smc; /* private board structure pointer */
skfddi_priv *bp; skfddi_priv *bp;
if (dev == NULL) {
printk("%s: irq %d for unknown device\n", dev->name, irq);
return IRQ_NONE;
}
smc = netdev_priv(dev); smc = netdev_priv(dev);
bp = &smc->os; bp = &smc->os;
......
...@@ -295,15 +295,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -295,15 +295,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
*/ */
static irqreturn_t sonic_interrupt(int irq, void *dev_id) static irqreturn_t sonic_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct sonic_local *lp = netdev_priv(dev); struct sonic_local *lp = netdev_priv(dev);
int status; int status;
if (dev == NULL) {
printk(KERN_ERR "sonic_interrupt: irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)) if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT))
return IRQ_NONE; return IRQ_NONE;
......
...@@ -2095,8 +2095,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) ...@@ -2095,8 +2095,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) static irqreturn_t happy_meal_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = dev_id;
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
HMD(("happy_meal_interrupt: status=%08x ", happy_status)); HMD(("happy_meal_interrupt: status=%08x ", happy_status));
......
...@@ -822,7 +822,7 @@ static void lance_tx_pio(struct net_device *dev) ...@@ -822,7 +822,7 @@ static void lance_tx_pio(struct net_device *dev)
static irqreturn_t lance_interrupt(int irq, void *dev_id) static irqreturn_t lance_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = dev_id;
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
int csr0; int csr0;
......
...@@ -468,7 +468,7 @@ static void qe_tx_reclaim(struct sunqe *qep); ...@@ -468,7 +468,7 @@ static void qe_tx_reclaim(struct sunqe *qep);
*/ */
static irqreturn_t qec_interrupt(int irq, void *dev_id) static irqreturn_t qec_interrupt(int irq, void *dev_id)
{ {
struct sunqec *qecp = (struct sunqec *) dev_id; struct sunqec *qecp = dev_id;
u32 qec_status; u32 qec_status;
int channel = 0; int channel = 0;
......
...@@ -1990,15 +1990,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id) ...@@ -1990,15 +1990,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
__u8 isb_type, isb_subtype; __u8 isb_type, isb_subtype;
__u16 isb_index; __u16 isb_index;
if(dev == NULL)
{
printk(KERN_CRIT "%s: irq %d for unknown device.\n", dev->name, irq);
return IRQ_NONE;
}
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
tp = netdev_priv(dev); tp = netdev_priv(dev);
if(tp->status == NOT_INITIALIZED) if(tp->status == NOT_INITIALIZED)
return IRQ_NONE; return IRQ_NONE;
......
...@@ -751,11 +751,6 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id) ...@@ -751,11 +751,6 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
unsigned short irq_type; unsigned short irq_type;
int handled = 0; int handled = 0;
if(dev == NULL) {
printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq);
return IRQ_NONE;
}
tp = netdev_priv(dev); tp = netdev_priv(dev);
irq_type = SIFREADW(SIFSTS); irq_type = SIFREADW(SIFSTS);
......
...@@ -1540,16 +1540,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) ...@@ -1540,16 +1540,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
static irqreturn_t static irqreturn_t
de4x5_interrupt(int irq, void *dev_id) de4x5_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = dev_id;
struct de4x5_private *lp; struct de4x5_private *lp;
s32 imr, omr, sts, limit; s32 imr, omr, sts, limit;
u_long iobase; u_long iobase;
unsigned int handled = 0; unsigned int handled = 0;
if (dev == NULL) {
printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
lp = netdev_priv(dev); lp = netdev_priv(dev);
spin_lock(&lp->lock); spin_lock(&lp->lock);
iobase = dev->base_addr; iobase = dev->base_addr;
......
...@@ -303,9 +303,9 @@ out: return ret; ...@@ -303,9 +303,9 @@ out: return ret;
*/ */
static irqreturn_t cycx_isr(int irq, void *dev_id) static irqreturn_t cycx_isr(int irq, void *dev_id)
{ {
struct cycx_device *card = (struct cycx_device *)dev_id; struct cycx_device *card = dev_id;
if (!card || card->wandev.state == WAN_UNCONFIGURED) if (card->wandev.state == WAN_UNCONFIGURED)
goto out; goto out;
if (card->in_isr) { if (card->in_isr) {
......
...@@ -875,13 +875,7 @@ static irqreturn_t sdla_isr(int irq, void *dev_id) ...@@ -875,13 +875,7 @@ static irqreturn_t sdla_isr(int irq, void *dev_id)
dev = dev_id; dev = dev_id;
if (dev == NULL) flp = netdev_priv(dev);
{
printk(KERN_WARNING "sdla_isr(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
flp = dev->priv;
if (!flp->initialized) if (!flp->initialized)
{ {
......
...@@ -1954,7 +1954,7 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw) ...@@ -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) 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); struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw; hermes_t *hw = &priv->hw;
int count = MAX_IRQLOOPS_PER_IRQ; int count = MAX_IRQLOOPS_PER_IRQ;
......
...@@ -4119,21 +4119,12 @@ static irqreturn_t ...@@ -4119,21 +4119,12 @@ static irqreturn_t
wavelan_interrupt(int irq, wavelan_interrupt(int irq,
void * dev_id) void * dev_id)
{ {
struct net_device * dev; struct net_device * dev = dev_id;
net_local * lp; net_local * lp;
kio_addr_t base; kio_addr_t base;
int status0; int status0;
u_int tx_status; 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 #ifdef DEBUG_INTERRUPT_TRACE
printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
#endif #endif
......
...@@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this) ...@@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this)
*/ */
static irqreturn_t wl3501_interrupt(int irq, void *dev_id) 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; struct wl3501_card *this;
int handled = 1;
if (!dev) this = netdev_priv(dev);
goto unknown;
this = dev->priv;
spin_lock(&this->lock); spin_lock(&this->lock);
wl3501_ack_interrupt(this); wl3501_ack_interrupt(this);
wl3501_block_interrupt(this); wl3501_block_interrupt(this);
wl3501_rx_interrupt(dev); wl3501_rx_interrupt(dev);
wl3501_unblock_interrupt(this); wl3501_unblock_interrupt(this);
spin_unlock(&this->lock); spin_unlock(&this->lock);
out:
return IRQ_RETVAL(handled); return IRQ_HANDLED;
unknown:
handled = 0;
printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq);
goto out;
} }
static int wl3501_reset_board(struct wl3501_card *this) static int wl3501_reset_board(struct wl3501_card *this)
......
...@@ -896,13 +896,6 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance) ...@@ -896,13 +896,6 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance)
int boguscnt = max_interrupt_work; int boguscnt = max_interrupt_work;
unsigned int handled = 0; unsigned int handled = 0;
#ifndef final_version /* Can never occur. */
if (dev == NULL) {
printk (KERN_ERR "yellowfin_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
#endif
yp = netdev_priv(dev); yp = netdev_priv(dev);
ioaddr = yp->base; ioaddr = yp->base;
......
...@@ -610,11 +610,6 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id) ...@@ -610,11 +610,6 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id)
int boguscnt = 20; int boguscnt = 20;
int handled = 0; int handled = 0;
if (dev == NULL) {
printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq);
return IRQ_NONE;
}
spin_lock (&znet->lock); spin_lock (&znet->lock);
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部