]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/tty/serial/serial_core.c: fix uart_get_attr_port() shift
authorAndrew Morton <akpm@linux-foundation.org>
Fri, 9 Nov 2012 03:03:51 +0000 (14:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Nov 2012 05:15:17 +0000 (16:15 +1100)
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 <greg@kroah.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/tty/serial/serial_core.c

index 31af2a488101a35b1abfd2de39bbde45d173e84a..44274ea2d8676704746aa1fbb1fd4afb11799c4d 100644 (file)
@@ -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,