All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: serial:  jsm_tty: fixed a assignment in if condition
@ 2021-11-15 18:24 Sahil Patidar
  2021-11-15 18:42 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Sahil Patidar @ 2021-11-15 18:24 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Sahil Patidar

Fixed assignment in if condition.

Signed-off-by: Sahil Patidar <sahilpatidar4051@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index d74cbbbf33c6..44507b1ff93a 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -746,10 +746,10 @@ static void jsm_carrier(struct jsm_channel *ch)
 void jsm_check_queue_flow_control(struct jsm_channel *ch)
 {
 	struct board_ops *bd_ops = ch->ch_bd->bd_ops;
-	int qleft;
+	int qleft = ch->ch_r_tail - ch->ch_r_head - 1;
 
 	/* Store how much space we have left in the queue */
-	if ((qleft = ch->ch_r_tail - ch->ch_r_head - 1) < 0)
+	if (qleft < 0)
 		qleft += RQUEUEMASK + 1;
 
 	/*
-- 
2.32.0


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

* Re: [PATCH] tty: serial:  jsm_tty: fixed a assignment in if condition
  2021-11-15 18:24 [PATCH] tty: serial: jsm_tty: fixed a assignment in if condition Sahil Patidar
@ 2021-11-15 18:42 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-11-15 18:42 UTC (permalink / raw)
  To: Sahil Patidar; +Cc: linux-serial, linux-kernel

On Mon, Nov 15, 2021 at 11:54:13PM +0530, Sahil Patidar wrote:
> Fixed assignment in if condition.

What exactly is "fixed"?

And why are there two spaces in your subject line?

> 
> Signed-off-by: Sahil Patidar <sahilpatidar4051@gmail.com>
> ---
>  drivers/tty/serial/jsm/jsm_tty.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
> index d74cbbbf33c6..44507b1ff93a 100644
> --- a/drivers/tty/serial/jsm/jsm_tty.c
> +++ b/drivers/tty/serial/jsm/jsm_tty.c
> @@ -746,10 +746,10 @@ static void jsm_carrier(struct jsm_channel *ch)
>  void jsm_check_queue_flow_control(struct jsm_channel *ch)
>  {
>  	struct board_ops *bd_ops = ch->ch_bd->bd_ops;
> -	int qleft;
> +	int qleft = ch->ch_r_tail - ch->ch_r_head - 1;
>  
>  	/* Store how much space we have left in the queue */
> -	if ((qleft = ch->ch_r_tail - ch->ch_r_head - 1) < 0)
> +	if (qleft < 0)

What was wrong with the original code that required this change?

thanks,

greg k-h

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

end of thread, other threads:[~2021-11-16  0:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 18:24 [PATCH] tty: serial: jsm_tty: fixed a assignment in if condition Sahil Patidar
2021-11-15 18:42 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.