瀏覽代碼

[POWERPC] UPIO_TSI cleanup

(le32_to_cpu(x) >> 8) & 0xff is a very odd way to spell (x >> 16) & 0xff,
even if that code is hit only on ppc.  The value is host-endian - we've
got it from readl(), after all...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Al Viro 18 年之前
父節點
當前提交
9e84b60ed8
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/serial/8250.c

+ 2 - 2
drivers/serial/8250.c

@@ -320,8 +320,8 @@ static unsigned int serial_in(struct uart_8250_port *up, int offset)
 
 
 	case UPIO_TSI:
 	case UPIO_TSI:
 		if (offset == UART_IIR) {
 		if (offset == UART_IIR) {
-			tmp = readl((u32 *)(up->port.membase + UART_RX));
-			return (cpu_to_le32(tmp) >> 8) & 0xff;
+			tmp = readl(up->port.membase + (UART_IIR & ~3));
+			return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
 		} else
 		} else
 			return readb(up->port.membase + offset);
 			return readb(up->port.membase + offset);