summaryrefslogtreecommitdiff
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorHugo Villeneuve <hvilleneuve@dimonoff.com>2023-12-22 02:18:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-04 18:30:04 +0300
commit2e57cefc4477659527f7adab1f87cdbf60ef1ae6 (patch)
tree6724d9b0c60d3310b2a958a441a5b0fa3bec001f /drivers/tty/serial
parentdfb104213008e68ba4dd516ce4f329d676c449fb (diff)
downloadlinux-2e57cefc4477659527f7adab1f87cdbf60ef1ae6.tar.xz
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>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/sc16is7xx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index da862b8efcbe..3d963fe0e78a 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -486,7 +486,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
u8 prescaler = 0;
unsigned long clk = port->uartclk, div = clk / 16 / baud;
- if (div > 0xffff) {
+ if (div >= BIT(16)) {
prescaler = SC16IS7XX_MCR_CLKSEL_BIT;
div /= 4;
}