From: Andrew Morton Date: Fri, 9 Nov 2012 03:03:51 +0000 (+1100) Subject: drivers/tty/serial/serial_core.c: fix uart_get_attr_port() shift X-Git-Tag: next-20121112~5^2~272 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ed7c6ebf234c882ac1a24c81f706b1d62d6b5a80;p=karo-tx-linux.git drivers/tty/serial/serial_core.c: fix uart_get_attr_port() shift drivers/tty/serial/serial_core.c: In function 'uart_get_attr_port': drivers/tty/serial/serial_core.c:2412: warning: left shift count >= width of type Cc: Greg KH Cc: Alan Cox Signed-off-by: Andrew Morton --- diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 31af2a488101..44274ea2d867 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2407,9 +2407,13 @@ static ssize_t uart_get_attr_port(struct device *dev, { struct serial_struct tmp; struct tty_port *port = dev_get_drvdata(dev); + unsigned long ioaddr; uart_get_info(port, &tmp); - return snprintf(buf, PAGE_SIZE, "0x%lX\n", (unsigned long)(tmp.port | (tmp.port_high << HIGH_BITS_OFFSET))); + ioaddr = tmp.port; + if (HIGH_BITS_OFFSET) + ioaddr |= (unsigned long)tmp.port_high << HIGH_BITS_OFFSET; + return snprintf(buf, PAGE_SIZE, "0x%lX\n", ioaddr); } static ssize_t uart_get_attr_irq(struct device *dev,