From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756452AbcBVWyf (ORCPT ); Mon, 22 Feb 2016 17:54:35 -0500 Received: from [46.54.226.45] ([46.54.226.45]:49074 "EHLO mail.tnode.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756364AbcBVWya (ORCPT ); Mon, 22 Feb 2016 17:54:30 -0500 From: Andrej Krpic To: xinhuix.pan@intel.com Cc: linux-kernel@vger.kernel.org, jslaby@suse.com, gregkh@linuxfoundation.org, Andrej Krpic Subject: [PATCH 5/8] tty: n_gsm: replace dead code with a meaningful comment Date: Mon, 22 Feb 2016 23:53:13 +0100 Message-Id: <1456181596-11736-6-git-send-email-ak77@tnode.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456181596-11736-1-git-send-email-ak77@tnode.com> References: <1456181596-11736-1-git-send-email-ak77@tnode.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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