Skip to content

Commit aeb2b22

Browse files
hvilleneuvedoogregkh
authored andcommitted
serial: sc16is7xx: replace hardcoded divisor value with BIT() macro
[ Upstream commit 2e57cef ] 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]> Stable-dep-of: 8492bd9 ("serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler") Signed-off-by: Sasha Levin <[email protected]>
1 parent c0b8f49 commit aeb2b22

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
@@ -489,7 +489,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
489489
u8 prescaler = 0;
490490
unsigned long clk = port->uartclk, div = clk / 16 / baud;
491491

492-
if (div > 0xffff) {
492+
if (div >= BIT(16)) {
493493
prescaler = SC16IS7XX_MCR_CLKSEL_BIT;
494494
div /= 4;
495495
}

0 commit comments

Comments
 (0)