Skip to content

Commit

Permalink
serial: cast before shifting on port io
Browse files Browse the repository at this point in the history
Without this we will shift data into oblivion and give wrong results on
some configurations

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Alan Cox authored and gregkh committed Nov 16, 2012
1 parent 4bb535d commit 7a876b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7a876b3

Please sign in to comment.