add parentheses to expression to improve
code readability.
Signed-off-by: B K Karthik <[email protected]>
---
drivers/tty/serial/fsl_lpuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 0cc64279cd2d..3108f5ab57fa 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1167,7 +1167,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
* Calculate length of one DMA buffer size to keep latency below
* 10ms at any baud rate.
*/
- sport->rx_dma_rng_buf_len = (DMA_RX_TIMEOUT * baud / bits / 1000) * 2;
+ sport->rx_dma_rng_buf_len = (((DMA_RX_TIMEOUT * baud) / bits) / 1000) * 2;
if (sport->rx_dma_rng_buf_len != 0)
sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1));
if (sport->rx_dma_rng_buf_len < 16)
--
2.20.1
On Tue, Jul 21, 2020 at 10:44:12PM +0530, B K Karthik wrote:
> add parentheses to expression to improve
> code readability.
>
> Signed-off-by: B K Karthik <[email protected]>
> ---
> drivers/tty/serial/fsl_lpuart.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
> index 0cc64279cd2d..3108f5ab57fa 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -1167,7 +1167,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
> * Calculate length of one DMA buffer size to keep latency below
> * 10ms at any baud rate.
> */
> - sport->rx_dma_rng_buf_len = (DMA_RX_TIMEOUT * baud / bits / 1000) * 2;
> + sport->rx_dma_rng_buf_len = (((DMA_RX_TIMEOUT * baud) / bits) / 1000) * 2;
No, what is there is more readable, don't force people to try to
remember the order of operations. I totally disagree with checkpatch
here.
thanks,
greg k-h