Skip to content

Commit

Permalink
[PATCH] Serial: Ensure error paths are marked with unlikely()
Browse files Browse the repository at this point in the history
Ensure ARM serial driver error paths are marked with the
unlikely() compiler hint.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
  • Loading branch information
Russell King committed Apr 26, 2005
1 parent b453257 commit 4584928
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/serial/21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r
port->icount.rx++;

rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ;
if (rxs & RXSTAT_ANYERR) {
if (unlikely(rxs & RXSTAT_ANYERR)) {
if (rxs & RXSTAT_PARITY)
port->icount.parity++;
else if (rxs & RXSTAT_FRAME)
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/amba-pl010.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pl010_rx_chars(struct uart_port *port)
* out of the main execution path
*/
rsr = UART_GET_RSR(port) | UART_DUMMY_RSR_RX;
if (rsr & UART01x_RSR_ANY) {
if (unlikely(rsr & UART01x_RSR_ANY)) {
if (rsr & UART01x_RSR_BE) {
rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
port->icount.brk++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pl011_rx_chars(struct uart_amba_port *uap)
* out of the main execution path
*/
rsr = readw(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
if (rsr & UART01x_RSR_ANY) {
if (unlikely(rsr & UART01x_RSR_ANY)) {
if (rsr & UART01x_RSR_BE) {
rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
uap->port.icount.brk++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ 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 (ch & UART_ANY_ERR)
if (unlikely(ch & UART_ANY_ERR))
goto handle_error;

if (uart_handle_sysrq_char(port, ch, regs))
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id, struct pt_regs *regs)
flag = TTY_NORMAL;
port->icount.rx++;

if (uerstat & S3C2410_UERSTAT_ANY) {
if (unlikely(uerstat & S3C2410_UERSTAT_ANY)) {
dbg("rxerr: port ch=0x%02x, rxs=0x%08x\n",
ch, uerstat);

Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/serial_lh7a40x.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ lh7a40xuart_rx_chars (struct uart_port* port)
flag = TTY_NORMAL;
++port->icount.rx;

if (data & RxError) { /* Quick check, short-circuit */
if (unlikely(data & RxError)) { /* Quick check, short-circuit */
if (data & RxBreak) {
data &= ~(RxFramingError | RxParityError);
++port->icount.brk;
Expand Down

0 comments on commit 4584928

Please sign in to comment.