summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/jsm
diff options
context:
space:
mode:
authorJakob Østergaard Jensen <jakob.jensen.91@gmail.com>2016-02-07 12:36:12 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 13:36:09 -0800
commit98cb4ab09e772d791b7150c38574a024b9801b47 (patch)
treed172de5fed44bdcb3f7f540d596b0922a4bed0be /drivers/tty/serial/jsm
parente882f7158f102ef148a2d96eb4cb50cc88830c87 (diff)
tty: serial: jsm_tty: fixed redundant variable issue.
The variable "len" gets assigned once and it's value copied to "n", which is then used for the rest of the function. This patch fixes the unnecessary variable reassignment by using "len" throughout the function instead. Signed-off-by: Jakob Østergaard Jensen <jakob.jensen.91@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/jsm')
-rw-r--r--drivers/tty/serial/jsm/jsm_tty.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 00cac10ae75a..c5ddfe542451 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;
@@ -597,16 +596,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;
@@ -637,7 +635,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;
}