summaryrefslogtreecommitdiffstats
path: root/drivers/serial/clps711x.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-26 15:32:00 +0100
committerRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-26 15:32:00 +0100
commit2a9604b863c854e5bee409157aabb35b6ce8ecd3 (patch)
tree5e806532eb739615ba0cc21797707a44fea83423 /drivers/serial/clps711x.c
parent45849282bfd7543253761cbf7db96151b05e5ed1 (diff)
downloadkernel-crypto-2a9604b863c854e5bee409157aabb35b6ce8ecd3.tar.gz
kernel-crypto-2a9604b863c854e5bee409157aabb35b6ce8ecd3.tar.xz
kernel-crypto-2a9604b863c854e5bee409157aabb35b6ce8ecd3.zip
[PATCH] Serial: Move error path processing inline
With unlikely() there's no need for the error path to use gotos. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/clps711x.c')
-rw-r--r--drivers/serial/clps711x.c65
1 files changed, 27 insertions, 38 deletions
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index e145e19b3fb..6242f3090a9 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -116,54 +116,43 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *re
* Note that the error handling code is
* out of the main execution path
*/
- if (unlikely(ch & UART_ANY_ERR))
- goto handle_error;
+ if (unlikely(ch & UART_ANY_ERR)) {
+ if (ch & UARTDR_PARERR)
+ port->icount.parity++;
+ else if (ch & UARTDR_FRMERR)
+ port->icount.frame++;
+ if (ch & UARTDR_OVERR)
+ port->icount.overrun++;
- if (uart_handle_sysrq_char(port, ch, regs))
- goto ignore_char;
+ ch &= port->read_status_mask;
- error_return:
- tty_insert_flip_char(tty, ch, flg);
- ignore_char:
- status = clps_readl(SYSFLG(port));
- }
- out:
- tty_flip_buffer_push(tty);
- return IRQ_HANDLED;
+ if (ch & UARTDR_PARERR)
+ flg = TTY_PARITY;
+ else if (ch & UARTDR_FRMERR)
+ flg = TTY_FRAME;
- handle_error:
- if (ch & UARTDR_PARERR)
- port->icount.parity++;
- else if (ch & UARTDR_FRMERR)
- port->icount.frame++;
- if (ch & UARTDR_OVERR)
- port->icount.overrun++;
-
- if (ch & port->ignore_status_mask) {
- if (++ignored > 100)
- goto out;
- goto ignore_char;
- }
- ch &= port->read_status_mask;
+#ifdef SUPPORT_SYSRQ
+ port->sysrq = 0;
+#endif
+ }
- if (ch & UARTDR_PARERR)
- flg = TTY_PARITY;
- else if (ch & UARTDR_FRMERR)
- flg = TTY_FRAME;
+ if (uart_handle_sysrq_char(port, ch, regs))
+ goto ignore_char;
- if (ch & UARTDR_OVERR) {
/*
* CHECK: does overrun affect the current character?
* ASSUMPTION: it does not.
*/
- tty_insert_flip_char(tty, ch, flg);
- ch = 0;
- flg = TTY_OVERRUN;
+ if ((ch & port->ignore_status_mask & ~RXSTAT_OVERRUN) == 0)
+ tty_insert_flip_char(tty, ch, flg);
+ if ((ch & ~port->ignore_status_mask & RXSTAT_OVERRUN) == 0)
+ tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+
+ ignore_char:
+ status = clps_readl(SYSFLG(port));
}
-#ifdef SUPPORT_SYSRQ
- port->sysrq = 0;
-#endif
- goto error_return;
+ tty_flip_buffer_push(tty);
+ return IRQ_HANDLED;
}
static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)