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 <andy.shevchenko@gmail.com> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20231221231823.2327894-13-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dfb1042 commit 2e57cef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)