Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Serial: Ensure error paths are marked with unlikely()

Ensure ARM serial driver error paths are marked with the
unlikely() compiler hint.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>

+6 -6
+1 -1
drivers/serial/21285.c
··· 110 110 port->icount.rx++; 111 111 112 112 rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ; 113 - if (rxs & RXSTAT_ANYERR) { 113 + if (unlikely(rxs & RXSTAT_ANYERR)) { 114 114 if (rxs & RXSTAT_PARITY) 115 115 port->icount.parity++; 116 116 else if (rxs & RXSTAT_FRAME)
+1 -1
drivers/serial/amba-pl010.c
··· 172 172 * out of the main execution path 173 173 */ 174 174 rsr = UART_GET_RSR(port) | UART_DUMMY_RSR_RX; 175 - if (rsr & UART01x_RSR_ANY) { 175 + if (unlikely(rsr & UART01x_RSR_ANY)) { 176 176 if (rsr & UART01x_RSR_BE) { 177 177 rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); 178 178 port->icount.brk++;
+1 -1
drivers/serial/amba-pl011.c
··· 137 137 * out of the main execution path 138 138 */ 139 139 rsr = readw(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX; 140 - if (rsr & UART01x_RSR_ANY) { 140 + if (unlikely(rsr & UART01x_RSR_ANY)) { 141 141 if (rsr & UART01x_RSR_BE) { 142 142 rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); 143 143 uap->port.icount.brk++;
+1 -1
drivers/serial/clps711x.c
··· 116 116 * Note that the error handling code is 117 117 * out of the main execution path 118 118 */ 119 - if (ch & UART_ANY_ERR) 119 + if (unlikely(ch & UART_ANY_ERR)) 120 120 goto handle_error; 121 121 122 122 if (uart_handle_sysrq_char(port, ch, regs))
+1 -1
drivers/serial/s3c2410.c
··· 364 364 flag = TTY_NORMAL; 365 365 port->icount.rx++; 366 366 367 - if (uerstat & S3C2410_UERSTAT_ANY) { 367 + if (unlikely(uerstat & S3C2410_UERSTAT_ANY)) { 368 368 dbg("rxerr: port ch=0x%02x, rxs=0x%08x\n", 369 369 ch, uerstat); 370 370
+1 -1
drivers/serial/serial_lh7a40x.c
··· 162 162 flag = TTY_NORMAL; 163 163 ++port->icount.rx; 164 164 165 - if (data & RxError) { /* Quick check, short-circuit */ 165 + if (unlikely(data & RxError)) { /* Quick check, short-circuit */ 166 166 if (data & RxBreak) { 167 167 data &= ~(RxFramingError | RxParityError); 168 168 ++port->icount.brk;