提交 8e70c47c 编写于 作者: K Karthikeyan Ramasubramanian 提交者: Greg Kroah-Hartman

tty: serial: qcom_geni_serial: Use min3 to find minimum of 3 values

Use min3 helper to calculate the minimum value of 3 variables.
Signed-off-by: NKarthikeyan Ramasubramanian <kramasub@codeaurora.org>
Reviewed-by: NMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: NStephen Boyd <swboyd@chromium.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6a10635e
......@@ -586,11 +586,7 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport)
avail = (port->tx_fifo_depth - port->tx_wm) * port->tx_bytes_pw;
tail = (xmit->tail + port->xmit_size) & (UART_XMIT_SIZE - 1);
if (chunk > (UART_XMIT_SIZE - tail))
chunk = UART_XMIT_SIZE - tail;
if (chunk > avail)
chunk = avail;
chunk = min3((size_t)chunk, (size_t)(UART_XMIT_SIZE - tail), avail);
if (!chunk)
goto out_write_wakeup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册