From: Al Viro Date: Sat, 23 Sep 2006 00:39:45 +0000 (+0100) Subject: [POWERPC] UPIO_TSI cleanup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e84b60ed87f5fe2dce10be2db1bfbb926a49e66;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [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 Signed-off-by: Paul Mackerras --- diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 0ae9ced00ed4..10c2daab99ac 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -320,8 +320,8 @@ static unsigned int serial_in(struct uart_8250_port *up, int offset) case UPIO_TSI: 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 return readb(up->port.membase + offset);