Skip to content

Commit

Permalink
Merge branch 'irqclean-submit1' of master.kernel.org:/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jgarzik/misc-2.6

* 'irqclean-submit1' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  drivers/isdn/act2000: kill irq2card_map
  drivers/net/eepro: kill dead code
  Various drivers' irq handlers: kill dead code, needless casts
  drivers/net: eliminate irq handler impossible checks, needless casts
  arch/i386/kernel/time: don't shadow 'irq' function arg
  • Loading branch information
Linus Torvalds committed Oct 9, 2006
2 parents 659564c + 5d347c8 commit 5a43c09
Show file tree
Hide file tree
Showing 74 changed files with 106 additions and 329 deletions.
4 changes: 2 additions & 2 deletions arch/i386/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
high bit of the PPI port B (0x61). Note that some PS/2s,
notably the 55SX, work fine if this is removed. */

irq = inb_p( 0x61 ); /* read the current state */
outb_p( irq|0x80, 0x61 ); /* reset the IRQ */
u8 irq_v = inb_p( 0x61 ); /* read the current state */
outb_p( irq_v|0x80, 0x61 ); /* reset the IRQ */
}

write_sequnlock(&xtime_lock);
Expand Down
7 changes: 1 addition & 6 deletions drivers/atm/ambassador.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
9 changes: 0 additions & 9 deletions drivers/atm/horizon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions drivers/atm/lanai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down
14 changes: 7 additions & 7 deletions drivers/block/DAC960.c
Original file line number Diff line number Diff line change
Expand Up @@ -5254,7 +5254,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
DAC960_V2_StatusMailbox_T *NextStatusMailbox;
unsigned long flags;
Expand Down Expand Up @@ -5295,7 +5295,7 @@ static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel,
static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
DAC960_V2_StatusMailbox_T *NextStatusMailbox;
unsigned long flags;
Expand Down Expand Up @@ -5337,7 +5337,7 @@ static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel,
static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
DAC960_V2_StatusMailbox_T *NextStatusMailbox;
unsigned long flags;
Expand Down Expand Up @@ -5379,7 +5379,7 @@ static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel,
static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
DAC960_V1_StatusMailbox_T *NextStatusMailbox;
unsigned long flags;
Expand Down Expand Up @@ -5417,7 +5417,7 @@ static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel,
static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
DAC960_V1_StatusMailbox_T *NextStatusMailbox;
unsigned long flags;
Expand Down Expand Up @@ -5455,7 +5455,7 @@ static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel,
static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
unsigned long flags;

Expand Down Expand Up @@ -5493,7 +5493,7 @@ static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel,
static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel,
void *DeviceIdentifier)
{
DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier;
DAC960_Controller_T *Controller = DeviceIdentifier;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
unsigned long flags;

Expand Down
4 changes: 0 additions & 4 deletions drivers/cdrom/mcdx.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,6 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id)
struct s_drive_stuff *stuffp = dev_id;
unsigned char b;

if (stuffp == NULL) {
xwarn("mcdx: no device for intr %d\n", irq);
return IRQ_NONE;
}
#ifdef AK2
if (!stuffp->busy && stuffp->pending)
stuffp->int_err = 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/rio/func.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int);

/* riointr.c */
void RIOTxEnable(char *);
void RIOServiceHost(struct rio_info *, struct Host *, int);
void RIOServiceHost(struct rio_info *, struct Host *);
int riotproc(struct rio_info *, struct ttystatics *, int, int);

/* rioparam.c */
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/rio/rio_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
struct Host *HostP;
func_enter();

HostP = (struct Host *) ptr; /* &p->RIOHosts[(long)ptr]; */
HostP = ptr; /* &p->RIOHosts[(long)ptr]; */
rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec);

/* AAargh! The order in which to do these things is essential and
Expand Down Expand Up @@ -402,7 +402,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
return IRQ_HANDLED;
}

RIOServiceHost(p, HostP, irq);
RIOServiceHost(p, HostP);

rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type);

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/rio/riointr.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static int RupIntr;
static int RxIntr;
static int TxIntr;

void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
void RIOServiceHost(struct rio_info *p, struct Host *HostP)
{
rio_spin_lock(&HostP->HostLock);
if ((HostP->Flags & RUN_STATE) != RC_RUNNING) {
Expand Down
7 changes: 3 additions & 4 deletions drivers/char/riscom8.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,10 @@ static irqreturn_t rc_interrupt(int irq, void * dev_id)
int handled = 0;

bp = IRQ_to_board[irq];
if (!bp || !(bp->flags & RC_BOARD_ACTIVE)) {

if (!(bp->flags & RC_BOARD_ACTIVE))
return IRQ_NONE;
}


while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) &
(RC_BSR_TOUT | RC_BSR_TINT |
RC_BSR_MINT | RC_BSR_RINT))) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/specialix.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ static irqreturn_t sx_interrupt(int irq, void *dev_id)
spin_lock_irqsave(&bp->lock, flags);

dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1);
if (!bp || !(bp->flags & SX_BOARD_ACTIVE)) {
if (!(bp->flags & SX_BOARD_ACTIVE)) {
dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq);
spin_unlock_irqrestore(&bp->lock, flags);
func_exit();
Expand Down
22 changes: 6 additions & 16 deletions drivers/isdn/act2000/act2000_isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include "act2000_isa.h"
#include "capi.h"

static act2000_card *irq2card_map[16];

/*
* Reset Controller, then try to read the Card's signature.
+ Return:
Expand Down Expand Up @@ -65,14 +63,9 @@ act2000_isa_detect(unsigned short portbase)
static irqreturn_t
act2000_isa_interrupt(int irq, void *dev_id)
{
act2000_card *card = irq2card_map[irq];
act2000_card *card = dev_id;
u_char istatus;

if (!card) {
printk(KERN_WARNING
"act2000: Spurious interrupt!\n");
return IRQ_NONE;
}
istatus = (inb(ISA_PORT_ISR) & 0x07);
if (istatus & ISA_ISR_OUT) {
/* RX fifo has data */
Expand Down Expand Up @@ -139,17 +132,15 @@ int
act2000_isa_config_irq(act2000_card * card, short irq)
{
if (card->flags & ACT2000_FLAGS_IVALID) {
free_irq(card->irq, NULL);
irq2card_map[card->irq] = NULL;
free_irq(card->irq, card);
}
card->flags &= ~ACT2000_FLAGS_IVALID;
outb(ISA_COR_IRQOFF, ISA_PORT_COR);
if (!irq)
return 0;

if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) {
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
card->irq = irq;
irq2card_map[card->irq] = card;
card->flags |= ACT2000_FLAGS_IVALID;
printk(KERN_WARNING
"act2000: Could not request irq %d\n",irq);
Expand Down Expand Up @@ -188,10 +179,9 @@ act2000_isa_release(act2000_card * card)
unsigned long flags;

spin_lock_irqsave(&card->lock, flags);
if (card->flags & ACT2000_FLAGS_IVALID) {
free_irq(card->irq, NULL);
irq2card_map[card->irq] = NULL;
}
if (card->flags & ACT2000_FLAGS_IVALID)
free_irq(card->irq, card);

card->flags &= ~ACT2000_FLAGS_IVALID;
if (card->flags & ACT2000_FLAGS_PVALID)
release_region(card->port, ISA_REGION);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/zoran_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ zoran_irq (int irq,
struct zoran *zr;
unsigned long flags;

zr = (struct zoran *) dev_id;
zr = dev_id;
count = 0;

if (zr->testing) {
Expand Down
7 changes: 1 addition & 6 deletions drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
static irqreturn_t
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;
int ioaddr, status;
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);
spin_lock(&lp->lock);

Expand Down
7 changes: 2 additions & 5 deletions drivers/net/3c523.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr)
static irqreturn_t
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;
struct priv *p;

if (dev == NULL) {
printk(KERN_ERR "elmc-interrupt: irq %d for unknown device.\n", irq);
return IRQ_NONE;
} else if (!netif_running(dev)) {
if (!netif_running(dev)) {
/* 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
really annoying if we haven't finished initializing it. I was
Expand Down
5 changes: 0 additions & 5 deletions drivers/net/3c527.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id)
int rx_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;
lp = netdev_priv(dev);

Expand Down
8 changes: 1 addition & 7 deletions drivers/net/8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id)
int interrupts, nr_serviced = 0;
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;
ei_local = (struct ei_device *) netdev_priv(dev);
ei_local = netdev_priv(dev);

/*
* Protect the irq test too.
Expand Down
6 changes: 1 addition & 5 deletions drivers/net/atp.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
Handle the network interface interrupts. */
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;
long ioaddr;
static int num_tx_since_rx;
int boguscount = max_interrupt_work;
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;
lp = netdev_priv(dev);

Expand Down
6 changes: 0 additions & 6 deletions drivers/net/de600.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id)
int retrig = 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);

select_nic();
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/declance.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,15 @@ static void lance_tx(struct net_device *dev)

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);
return IRQ_HANDLED;
}

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);
volatile struct lance_regs *ll = lp->ll;
int csr0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/dgrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct net_device *dev0 = (struct net_device *) dev_id;
DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv;
struct net_device *dev0 = dev_id;
DGRS_PRIV *priv0 = dev0->priv;
I596_CB *cbp;
int cmd;
int i;
Expand Down
Loading

0 comments on commit 5a43c09

Please sign in to comment.