Skip to content

Commit f73fd75

Browse files
Shenwei Wanggregkh
authored andcommitted
tty: serial: fsl_lpuart: adjust buffer length to the intended size
Based on the fls function definition provided below, we should not subtract 1 to obtain the correct buffer length: fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. Fixes: 5887ad4 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx") Signed-off-by: Shenwei Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9e4f2a8 commit f73fd75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
12961296
* 10ms at any baud rate.
12971297
*/
12981298
sport->rx_dma_rng_buf_len = (DMA_RX_TIMEOUT * baud / bits / 1000) * 2;
1299-
sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1));
1299+
sport->rx_dma_rng_buf_len = (1 << fls(sport->rx_dma_rng_buf_len));
13001300
if (sport->rx_dma_rng_buf_len < 16)
13011301
sport->rx_dma_rng_buf_len = 16;
13021302

0 commit comments

Comments
 (0)