Skip to content

Commit

Permalink
drivers/tty/serial/serial_core.c: clean up HIGH_BITS_OFFSET usage
Browse files Browse the repository at this point in the history
serial_core.c usually does

	if (HIGH_BITS_OFFSET)
		expr-involving-HIGH_BITS_OFFSET()

at least to avoid generating useless code on 32-bit machines, where
HIGH_BITS_OFFSET is zero.  Do that in uart_get_attr_port().

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andrew Morton authored and Greg Kroah-Hartman committed Nov 27, 2012
1 parent d53c57d commit fd985e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2370,9 +2370,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 | (((unsigned long)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,
Expand Down

0 comments on commit fd985e1

Please sign in to comment.