Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1338993 > unrolled thread

[PATCH 5/8] tty: n_gsm: replace dead code with a meaningful comment

Started byAndrej Krpic <ak77@tnode.com>
First post2016-02-21 22:50 +0100
Last post2016-02-21 22:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/8] tty: n_gsm: replace dead code with a meaningful comment Andrej Krpic <ak77@tnode.com> - 2016-02-21 22:50 +0100

#1338993 — [PATCH 5/8] tty: n_gsm: replace dead code with a meaningful comment

FromAndrej Krpic <ak77@tnode.com>
Date2016-02-21 22:50 +0100
Subject[PATCH 5/8] tty: n_gsm: replace dead code with a meaningful comment
Message-ID<r4K38-3NN-15@gated-at.bofh.it>
UI/UIH frame can be received as a command from other station or
as a response to a command we issued earlier.

Add this knowledge to the source code as a comment and remove
useless #if 0/#endif block.

Signed-off-by: Andrej Krpic <ak77@tnode.com>
---
 drivers/tty/n_gsm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 8551fa4..3c4c521 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -1852,10 +1852,11 @@ static void gsm_queue(struct gsm_mux *gsm)
 	case UI|PF:
 	case UIH:
 	case UIH|PF:
-#if 0
-		if (cr)
-			goto invalid;
-#endif
+		/* Don't reject frames based on cr value as UI/UIH
+		 * frame can be received as a command from other
+		 * station or as a response to a command we issued
+		 * earlier.
+		 */
 		if (dlci == NULL || dlci->state != DLCI_OPEN) {
 			gsm_response(gsm, address, DM|PF);
 			return;
-- 
2.7.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web