Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 2/2] tty: serial: fsl_lpuart.c: fix a parentheses coding style issue
@ 2020-07-21 17:14 B K Karthik
  2020-07-21 17:33 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: B K Karthik @ 2020-07-21 17:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel


[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

add parentheses to expression to improve
code readability.

Signed-off-by: B K Karthik <bkkarthik@pesu.pes.edu>
---
 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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] tty: serial: fsl_lpuart.c: fix a parentheses coding style issue
  2020-07-21 17:14 [PATCH 2/2] tty: serial: fsl_lpuart.c: fix a parentheses coding style issue B K Karthik
@ 2020-07-21 17:33 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2020-07-21 17:33 UTC (permalink / raw)
  To: B K Karthik; +Cc: Jiri Slaby, linux-serial, linux-kernel

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 <bkkarthik@pesu.pes.edu>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 17:14 [PATCH 2/2] tty: serial: fsl_lpuart.c: fix a parentheses coding style issue B K Karthik
2020-07-21 17:33 ` Greg Kroah-Hartman

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git