drivers/tty/serial/serial_core.c: clean up HIGH_BITS_OFFSET usage
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>
This commit is contained in:
parent
d53c57dca2
commit
fd985e1def
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue