diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index cbbf239aea0f104b8f52f266eabd924db11fefd2..3c25e9f0b579080648f2fc6d09cb862629d9e1d2 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -2504,7 +2504,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, * last stop bit; we can increase the error * margin by shifting the sampling point. */ - int shift = min(-8, max(7, deviation / 2)); + int shift = clamp(deviation / 2, -8, 7); hssrr |= (shift << HSCIF_SRHP_SHIFT) & HSCIF_SRHP_MASK;