Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094AbbG0OGP (ORCPT ); Mon, 27 Jul 2015 10:06:15 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:35990 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753857AbbG0OGM (ORCPT ); Mon, 27 Jul 2015 10:06:12 -0400 From: Shraddha Barke To: Lidza Louina , Mark Hounschell , Greg Kroah-Hartman , Julia Lawall Cc: driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Shraddha Barke Subject: [PATCH] Staging: dgnc: Merge lines and remove unused variable for immediate return Date: Mon, 27 Jul 2015 19:35:15 +0530 Message-Id: <1438005915-6654-1-git-send-email-shraddha.6596@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1518 Lines: 59 This patch compresses two lines into a single line if immediate return is found. Variable rc is dropped as it is no longer needed. Semantic patch used for this is as follows: @@ type T; identifier i,f; constant C; @@ - T i; ...when != i when strict ( return -C; | - i = + return f(...); - return i; ) Signed-off-by: Shraddha Barke --- drivers/staging/dgnc/dgnc_neo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 900e3ae..321783c 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1316,7 +1316,6 @@ static int neo_drain(struct tty_struct *tty, uint seconds) unsigned long flags; struct channel_t *ch; struct un_t *un; - int rc = 0; if (!tty || tty->magic != TTY_MAGIC) return -ENXIO; @@ -1339,10 +1338,7 @@ static int neo_drain(struct tty_struct *tty, uint seconds) * * NOTE: TODO: Do something with time passed in. */ - rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0)); - - /* If ret is non-zero, user ctrl-c'ed us */ - return rc; + return wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0)); } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/