From patchwork Tue Jul 12 10:22:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9225013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 06B7A60871 for ; Tue, 12 Jul 2016 10:23:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E791B27C39 for ; Tue, 12 Jul 2016 10:23:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB17C27E78; Tue, 12 Jul 2016 10:23:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E06C27E66 for ; Tue, 12 Jul 2016 10:23:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 381AD26572D; Tue, 12 Jul 2016 12:23:31 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 23F7A26548D; Tue, 12 Jul 2016 12:23:24 +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 79A752654D4; Tue, 12 Jul 2016 12:23:22 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id ADB41265342 for ; Tue, 12 Jul 2016 12:23:15 +0200 (CEST) Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1bMuqR-0002ao-0a; Tue, 12 Jul 2016 10:23:15 +0000 From: Colin King To: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Date: Tue, 12 Jul 2016 11:22:40 +0100 Message-Id: <1468318960-6979-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.8.1 Cc: linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: ak4117: remove redundant check on err being < 0 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: Colin Ian King snd_ak4117_create checks if the error return err is less than zero or not. This is a redundant check, err can only be < 0 to get to the __fail label, in which case just return err and remove the redundant check (since we never return -EIO). Signed-off-by: Colin Ian King --- sound/i2c/other/ak4117.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 48848909..0702f05 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -110,7 +110,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t __fail: snd_ak4117_free(chip); - return err < 0 ? err : -EIO; + return err; } void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val)