aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/clps711x.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-26 10:32:00 -0400
committerRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-26 10:32:00 -0400
commit2a9604b863c854e5bee409157aabb35b6ce8ecd3 (patch)
tree5e806532eb739615ba0cc21797707a44fea83423 /drivers/serial/clps711x.c
parent45849282bfd7543253761cbf7db96151b05e5ed1 (diff)
[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 e145e19b3fb5..6242f3090a96 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
116 * Note that the error handling code is 116 * Note that the error handling code is
117 * out of the main execution path 117 * out of the main execution path
118 */ 118 */
119 if (unlikely(ch & UART_ANY_ERR)) 119 if (unlikely(ch & UART_ANY_ERR)) {
120 goto handle_error; 120 if (ch & UARTDR_PARERR)
121 port->icount.parity++;
122 else if (ch & UARTDR_FRMERR)
123 port->icount.frame++;
124 if (ch & UARTDR_OVERR)
125 port->icount.overrun++;
121 126
122 if (uart_handle_sysrq_char(port, ch, regs)) 127 ch &= port->read_status_mask;
123 goto ignore_char;
124 128
125 error_return: 129 if (ch & UARTDR_PARERR)
126 tty_insert_flip_char(tty, ch, flg); 130 flg = TTY_PARITY;
127 ignore_char: 131 else if (ch & UARTDR_FRMERR)
128 status = clps_readl(SYSFLG(port)); 132 flg = TTY_FRAME;
129 }
130 out:
131 tty_flip_buffer_push(tty);
132 return IRQ_HANDLED;
133 133
134 handle_error: 134#ifdef SUPPORT_SYSRQ
135 if (ch & UARTDR_PARERR) 135 port->sysrq = 0;
136 port->icount.parity++; 136#endif
137 else if (ch & UARTDR_FRMERR) 137 }
138 port->icount.frame++;
139 if (ch & UARTDR_OVERR)
140 port->icount.overrun++;
141
142 if (ch & port->ignore_status_mask) {
143 if (++ignored > 100)
144 goto out;
145 goto ignore_char;
146 }
147 ch &= port->read_status_mask;
148 138
149 if (ch & UARTDR_PARERR) 139 if (uart_handle_sysrq_char(port, ch, regs))
150 flg = TTY_PARITY; 140 goto ignore_char;
151 else if (ch & UARTDR_FRMERR)
152 flg = TTY_FRAME;
153 141
154 if (ch & UARTDR_OVERR) {
155 /* 142 /*
156 * CHECK: does overrun affect the current character? 143 * CHECK: does overrun affect the current character?
157 * ASSUMPTION: it does not. 144 * ASSUMPTION: it does not.
158 */ 145 */
159 tty_insert_flip_char(tty, ch, flg); 146 if ((ch & port->ignore_status_mask & ~RXSTAT_OVERRUN) == 0)
160 ch = 0; 147 tty_insert_flip_char(tty, ch, flg);
161 flg = TTY_OVERRUN; 148 if ((ch & ~port->ignore_status_mask & RXSTAT_OVERRUN) == 0)
149 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
150
151 ignore_char:
152 status = clps_readl(SYSFLG(port));
162 } 153 }
163#ifdef SUPPORT_SYSRQ 154 tty_flip_buffer_push(tty);
164 port->sysrq = 0; 155 return IRQ_HANDLED;
165#endif
166 goto error_return;
167} 156}
168 157
169static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs) 158static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)