From 7a876b39b5bc94f67e8a3a7adfd270b8c21fc762 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 6 Nov 2012 14:30:28 +0000 Subject: serial: cast before shifting on port io Without this we will shift data into oblivion and give wrong results on some configurations Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index d3dd4ad..63b3388 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2366,7 +2366,7 @@ static ssize_t uart_get_attr_port(struct device *dev, struct tty_port *port = dev_get_drvdata(dev); uart_get_info(port, &tmp); - return snprintf(buf, PAGE_SIZE, "0x%lX\n", (unsigned long)(tmp.port | (tmp.port_high << HIGH_BITS_OFFSET))); + return snprintf(buf, PAGE_SIZE, "0x%lX\n", (unsigned long)(tmp.port | (((unsigned long)tmp.port_high) << HIGH_BITS_OFFSET))); } static ssize_t uart_get_attr_irq(struct device *dev, -- cgit v0.10.2