diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-10 12:45:19 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 21:51:29 +0300 |
commit | 18b95576bc6b9ef9270ec778e1d545c0ca8bbbbb (patch) | |
tree | 5d7e9555f8cb5123037630825a50e4ece606024e /drivers/char/mxser_new.c | |
parent | ed79ba12e981538a399012f226360db635b50570 (diff) | |
download | linux-18b95576bc6b9ef9270ec778e1d545c0ca8bbbbb.tar.xz |
[PATCH] Char: mxser_new, less loops in isr
Loop only 100^2 times, not 99999^2 times in isr (at most).
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mxser_new.c')
-rw-r--r-- | drivers/char/mxser_new.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index 945c7e1b4c34..042d1381ff6f 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c @@ -56,7 +56,7 @@ #define MXSER_BOARDS 4 /* Max. boards */ #define MXSER_PORTS_PER_BOARD 8 /* Max. ports per board */ #define MXSER_PORTS (MXSER_BOARDS * MXSER_PORTS_PER_BOARD) -#define MXSER_ISR_PASS_LIMIT 99999L +#define MXSER_ISR_PASS_LIMIT 100 #define MXSER_ERR_IOADDR -1 #define MXSER_ERR_IRQ -2 @@ -2222,8 +2222,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id) struct mxser_board *brd = NULL; struct mxser_port *port; int max, irqbits, bits, msr; - int pass_counter = 0; - unsigned int int_cnt; + unsigned int int_cnt, pass_counter = 0; int handled = IRQ_NONE; for (i = 0; i < MXSER_BOARDS; i++) @@ -2237,7 +2236,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id) if (brd == NULL) goto irq_stop; max = brd->info->nports; - while (1) { + while (pass_counter++ < MXSER_ISR_PASS_LIMIT) { irqbits = inb(brd->vector) & brd->vector_mask; if (irqbits == brd->vector_mask) break; @@ -2308,8 +2307,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id) } while (int_cnt++ < MXSER_ISR_PASS_LIMIT); spin_unlock(&port->slock); } - if (pass_counter++ > MXSER_ISR_PASS_LIMIT) - break; /* Prevent infinite loops */ } irq_stop: |