[PATCH] Serial: Ensure error paths are marked with unlikely()
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 26 Apr 2005 14:29:44 +0000 (15:29 +0100)
committerRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 26 Apr 2005 14:29:44 +0000 (15:29 +0100)
Ensure ARM serial driver error paths are marked with the
unlikely() compiler hint.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
drivers/serial/21285.c
drivers/serial/amba-pl010.c
drivers/serial/amba-pl011.c
drivers/serial/clps711x.c
drivers/serial/s3c2410.c
drivers/serial/serial_lh7a40x.c

index f8504b0adebcd5e10fca98274c0eb459ef357481..33fbda79f3507f83f00ca3b9c8f9167f6500c136 100644 (file)
@@ -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)
index 484f6fb900b51feb5a90cb765aa1cd99da951f54..f2a5e2933c4709b2b56fc4167e041b0e366e5782 100644 (file)
@@ -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++;
index ff658a830f3401ea9c0f3932abc2ed12599acb5e..d5cbef3fe8b6adb42cf900aaffbec87494c8fdf8 100644 (file)
@@ -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++;
index 16592fae47f3c5e9a06d00b038f074c7f328ca5c..e145e19b3fb528141f02a774ee1db5ddbeccd0d7 100644 (file)
@@ -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))
index bd6782aeb8318367d7fb06f42593f5b5a6b5187e..435750d40a471001c860ba0b21b0443901534eab 100644 (file)
@@ -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);
 
index 4ce3a41f16116478d5b8664274ebbff00e763bda..85cfa08d3bad7955bb79279f73be920e332fb03f 100644 (file)
@@ -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;