All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tty: serial: jsm_tty: fixed redundant variable issue.
@ 2016-02-05 14:21 ` Jakob Østergaard Jensen
  0 siblings, 0 replies; 5+ messages in thread
From: Jakob Østergaard Jensen @ 2016-02-05 14:21 UTC (permalink / raw)
  To: cascardo, gregkh, jslaby
  Cc: linux-serial, linux-kernel, kernel-janitors,
	Jakob Østergaard Jensen

Fixes unnecessary variable reassignment to a new redundant variable.

Signed-off-by: Jakob Østergaard Jensen <jakob.jensen.91@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 524e86a..723169a 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -529,7 +529,6 @@ void jsm_input(struct jsm_channel *ch)
 	int data_len;
 	unsigned long lock_flags;
 	int len = 0;
-	int n = 0;
 	int s = 0;
 	int i = 0;
 
@@ -598,16 +597,15 @@ void jsm_input(struct jsm_channel *ch)
 	jsm_dbg(READ, &ch->ch_bd->pci_dev, "start 2\n");
 
 	len = tty_buffer_request_room(port, data_len);
-	n = len;
 
 	/*
-	 * n now contains the most amount of data we can copy,
+	 * len now contains the most amount of data we can copy,
 	 * bounded either by the flip buffer size or the amount
 	 * of data the card actually has pending...
 	 */
-	while (n) {
+	while (len) {
 		s = ((head >= tail) ? head : RQUEUESIZE) - tail;
-		s = min(s, n);
+		s = min(s, len);
 
 		if (s <= 0)
 			break;
@@ -638,7 +636,7 @@ void jsm_input(struct jsm_channel *ch)
 			tty_insert_flip_string(port, ch->ch_rqueue + tail, s);
 		}
 		tail += s;
-		n -= s;
+		len -= s;
 		/* Flip queue if needed */
 		tail &= rmask;
 	}
-- 
2.5.0

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

* [PATCH v2] tty: serial: jsm_tty: fixed redundant variable issue.
@ 2016-02-05 14:21 ` Jakob Østergaard Jensen
  0 siblings, 0 replies; 5+ messages in thread
From: Jakob Østergaard Jensen @ 2016-02-05 14:21 UTC (permalink / raw)
  To: cascardo, gregkh, jslaby
  Cc: linux-serial, linux-kernel, kernel-janitors,
	Jakob Østergaard Jensen

Fixes unnecessary variable reassignment to a new redundant variable.

Signed-off-by: Jakob Østergaard Jensen <jakob.jensen.91@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 524e86a..723169a 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -529,7 +529,6 @@ void jsm_input(struct jsm_channel *ch)
 	int data_len;
 	unsigned long lock_flags;
 	int len = 0;
-	int n = 0;
 	int s = 0;
 	int i = 0;
 
@@ -598,16 +597,15 @@ void jsm_input(struct jsm_channel *ch)
 	jsm_dbg(READ, &ch->ch_bd->pci_dev, "start 2\n");
 
 	len = tty_buffer_request_room(port, data_len);
-	n = len;
 
 	/*
-	 * n now contains the most amount of data we can copy,
+	 * len now contains the most amount of data we can copy,
 	 * bounded either by the flip buffer size or the amount
 	 * of data the card actually has pending...
 	 */
-	while (n) {
+	while (len) {
 		s = ((head >= tail) ? head : RQUEUESIZE) - tail;
-		s = min(s, n);
+		s = min(s, len);
 
 		if (s <= 0)
 			break;
@@ -638,7 +636,7 @@ void jsm_input(struct jsm_channel *ch)
 			tty_insert_flip_string(port, ch->ch_rqueue + tail, s);
 		}
 		tail += s;
-		n -= s;
+		len -= s;
 		/* Flip queue if needed */
 		tail &= rmask;
 	}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2] tty: serial: jsm_tty: fixed redundant variable issue.
  2016-02-05 14:21 ` Jakob Østergaard Jensen
  (?)
@ 2016-02-07  6:14   ` Greg KH
  -1 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-02-07  6:14 UTC (permalink / raw)
  To: Jakob Østergaard Jensen
  Cc: cascardo, jslaby, linux-serial, linux-kernel, kernel-janitors

On Fri, Feb 05, 2016 at 03:21:03PM +0100, Jakob Østergaard Jensen wrote:
> Fixes unnecessary variable reassignment to a new redundant variable.
> 
> Signed-off-by: Jakob Østergaard Jensen <jakob.jensen.91@gmail.com>
> ---
>  drivers/tty/serial/jsm/jsm_tty.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

What changed in v2?  Please always be specific.  I'll drop this, please
resend v3 and describe what changed in the proper way.

thanks,

greg k-h

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

* Re: [PATCH v2] tty: serial: jsm_tty: fixed redundant variable issue.
@ 2016-02-07  6:14   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-02-07  6:14 UTC (permalink / raw)
  To: Jakob Østergaard Jensen
  Cc: cascardo, jslaby, linux-serial, linux-kernel, kernel-janitors

On Fri, Feb 05, 2016 at 03:21:03PM +0100, Jakob Østergaard Jensen wrote:
> Fixes unnecessary variable reassignment to a new redundant variable.
> 
> Signed-off-by: Jakob Østergaard Jensen <jakob.jensen.91@gmail.com>
> ---
>  drivers/tty/serial/jsm/jsm_tty.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

What changed in v2?  Please always be specific.  I'll drop this, please
resend v3 and describe what changed in the proper way.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2] tty: serial: jsm_tty: fixed redundant variable issue.
@ 2016-02-07  6:14   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-02-07  6:14 UTC (permalink / raw)
  To: Jakob Østergaard Jensen
  Cc: cascardo, jslaby, linux-serial, linux-kernel, kernel-janitors

On Fri, Feb 05, 2016 at 03:21:03PM +0100, Jakob Østergaard Jensen wrote:
> Fixes unnecessary variable reassignment to a new redundant variable.
> 
> Signed-off-by: Jakob Østergaard Jensen <jakob.jensen.91@gmail.com>
> ---
>  drivers/tty/serial/jsm/jsm_tty.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

What changed in v2?  Please always be specific.  I'll drop this, please
resend v3 and describe what changed in the proper way.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-02-07  6:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-05 14:21 [PATCH v2] tty: serial: jsm_tty: fixed redundant variable issue Jakob Østergaard Jensen
2016-02-05 14:21 ` Jakob Østergaard Jensen
2016-02-07  6:14 ` Greg KH
2016-02-07  6:14   ` Greg KH
2016-02-07  6:14   ` 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.