aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJakob Østergaard Jensen <jakob.jensen.91@gmail.com>2016-02-07 06:36:12 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 16:36:09 -0500
commit98cb4ab09e772d791b7150c38574a024b9801b47 (patch)
treed172de5fed44bdcb3f7f540d596b0922a4bed0be /drivers/tty
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')
-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)
529 int data_len; 529 int data_len;
530 unsigned long lock_flags; 530 unsigned long lock_flags;
531 int len = 0; 531 int len = 0;
532 int n = 0;
533 int s = 0; 532 int s = 0;
534 int i = 0; 533 int i = 0;
535 534
@@ -597,16 +596,15 @@ void jsm_input(struct jsm_channel *ch)
597 jsm_dbg(READ, &ch->ch_bd->pci_dev, "start 2\n"); 596 jsm_dbg(READ, &ch->ch_bd->pci_dev, "start 2\n");
598 597
599 len = tty_buffer_request_room(port, data_len); 598 len = tty_buffer_request_room(port, data_len);
600 n = len;
601 599
602 /* 600 /*
603 * n now contains the most amount of data we can copy, 601 * len now contains the most amount of data we can copy,
604 * bounded either by the flip buffer size or the amount 602 * bounded either by the flip buffer size or the amount
605 * of data the card actually has pending... 603 * of data the card actually has pending...
606 */ 604 */
607 while (n) { 605 while (len) {
608 s = ((head >= tail) ? head : RQUEUESIZE) - tail; 606 s = ((head >= tail) ? head : RQUEUESIZE) - tail;
609 s = min(s, n); 607 s = min(s, len);
610 608
611 if (s <= 0) 609 if (s <= 0)
612 break; 610 break;
@@ -637,7 +635,7 @@ void jsm_input(struct jsm_channel *ch)
637 tty_insert_flip_string(port, ch->ch_rqueue + tail, s); 635 tty_insert_flip_string(port, ch->ch_rqueue + tail, s);
638 } 636 }
639 tail += s; 637 tail += s;
640 n -= s; 638 len -= s;
641 /* Flip queue if needed */ 639 /* Flip queue if needed */
642 tail &= rmask; 640 tail &= rmask;
643 } 641 }