serial: cast before shifting on port io
authorAlan Cox <alan@linux.intel.com>
Tue, 6 Nov 2012 14:30:28 +0000 (14:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Nov 2012 00:59:58 +0000 (16:59 -0800)
Without this we will shift data into oblivion and give wrong results on
some configurations

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index d3dd4ad984f624e034b6554acd1c91ebf9e55ef6..63b33889d5151f5dd0712d4d8d216a023542604c 100644 (file)
@@ -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,