Skip to content

Commit 2e57cef

Browse files
hvilleneuvedoogregkh
authored andcommitted
serial: sc16is7xx: replace hardcoded divisor value with BIT() macro
To better show why the limit is what it is, since we have only 16 bits for the divisor. Reviewed-by: Andy Shevchenko <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Hugo Villeneuve <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dfb1042 commit 2e57cef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
486486
u8 prescaler = 0;
487487
unsigned long clk = port->uartclk, div = clk / 16 / baud;
488488

489-
if (div > 0xffff) {
489+
if (div >= BIT(16)) {
490490
prescaler = SC16IS7XX_MCR_CLKSEL_BIT;
491491
div /= 4;
492492
}

0 commit comments

Comments
 (0)