aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 }