From patchwork Mon May 19 04:31:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 4199251 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D28559F32B for ; Mon, 19 May 2014 04:33:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12DB920274 for ; Mon, 19 May 2014 04:33:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2DD882026C for ; Mon, 19 May 2014 04:33:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AC30526514A; Mon, 19 May 2014 06:33:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 69F5A2650EE; Mon, 19 May 2014 06:32:57 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CA12E2650D4; Mon, 19 May 2014 06:32:54 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by alsa0.perex.cz (Postfix) with ESMTP id AA7DB2650CE for ; Mon, 19 May 2014 06:32:47 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.98,865,1392159600"; d="scan'208";a="74474220" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 May 2014 06:32:47 +0200 From: Julia Lawall To: Jaroslav Kysela Date: Mon, 19 May 2014 06:31:10 +0200 Message-Id: <1400473875-22228-9-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400473875-22228-1-git-send-email-Julia.Lawall@lip6.fr> References: <1400473875-22228-1-git-send-email-Julia.Lawall@lip6.fr> Cc: Takashi Iwai , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 8/13] sound: mpu401.c: make return of 0 explicit X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julia Lawall Delete unnecessary local variable whose value is always 0 and that hides the fact that the result is always 0. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression ret; expression e; position p; @@ -ret = 0; ... when != ret = e return - ret + 0 ; // Signed-off-by: Julia Lawall --- sound/oss/mpu401.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index 25e4609..3bbc3ec 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c @@ -567,7 +567,6 @@ static int mpu401_out(int dev, unsigned char midi_byte) static int mpu401_command(int dev, mpu_command_rec * cmd) { int i, timeout, ok; - int ret = 0; unsigned long flags; struct mpu_config *devc; @@ -644,7 +643,6 @@ retry: } } } - ret = 0; cmd->data[0] = 0; if (cmd->nr_returns) @@ -666,7 +664,7 @@ retry: } } spin_unlock_irqrestore(&devc->lock,flags); - return ret; + return 0; } static int mpu_cmd(int dev, int cmd, int data)