From patchwork Thu Jan 7 07:15:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7973891 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 15986BEEE5 for ; Thu, 7 Jan 2016 07:18:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 468972015E for ; Thu, 7 Jan 2016 07:18:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2B42820142 for ; Thu, 7 Jan 2016 07:18:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 360D42658D5; Thu, 7 Jan 2016 08:18:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D6B4726576A; Thu, 7 Jan 2016 08:16:21 +0100 (CET) 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 ADD78265756; Thu, 7 Jan 2016 08:16:20 +0100 (CET) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id 0641A2654F2 for ; Thu, 7 Jan 2016 08:16:12 +0100 (CET) Received: by mail-pa0-f54.google.com with SMTP id yy13so159132729pab.3 for ; Wed, 06 Jan 2016 23:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ssLQlD/wcDM1zzdXjBuJQOc1anf/CLf09ATXjbR1LBc=; b=ymzq0LzydeE2XV8GoiTZkzAajH8V68kPxdB0MHuZDiCgn399bglEMdceyvsSZpXwNn yRvU3A4uEJoUTj+nwS2vupWfK8gjYvEA0z9MBdhtM8TM2I0ZAH5oRaUUVGhwk3JbUybu mnM9tvcVE68nGSjOIAFVxdoG8jBW3lg97vIYbIG63ZBMImQHa4sUz5fbbyQrZJFStgKc brQdslKhbjlJ/0LasrkvEeH6uFXKslLZTITi7Brt1yfaec1bx6b91wfg/xuHWf6Iwx+i 2xfEKSvYfyewh73cXF06Fd1D54Tl0pfTccYe4FXP7htC0QqcDwYElXBec/OqteDHzCOg EcvA== X-Received: by 10.67.5.69 with SMTP id ck5mr148346500pad.125.1452150971062; Wed, 06 Jan 2016 23:16:11 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.160]) by smtp.gmail.com with ESMTPSA id ah10sm149645792pad.23.2016.01.06.23.16.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 23:16:10 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Thu, 7 Jan 2016 12:45:50 +0530 Message-Id: <1452150951-1571-5-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452150951-1571-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1452150951-1571-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH 5/6] [ALSA] portman2x4 - assignment in if 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 It is not general practice to assign some values inside if statement. Signed-off-by: Sudip Mukherjee --- sound/drivers/portman2x4.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 985cf67..5fcde7d 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -743,7 +743,8 @@ static int snd_portman_probe(struct platform_device *pdev) if (!enable[dev]) return -ENOENT; - if ((err = snd_portman_probe_port(p)) < 0) + err = snd_portman_probe_port(p); + if (err < 0) return err; err = snd_card_new(&pdev->dev, index[dev], id[dev], THIS_MODULE, @@ -770,7 +771,8 @@ static int snd_portman_probe(struct platform_device *pdev) goto __err; } - if ((err = portman_create(card, pardev, &pm)) < 0) { + err = portman_create(card, pardev, &pm); + if (err < 0) { snd_printd("Cannot create main component\n"); parport_unregister_device(pardev); goto __err; @@ -778,7 +780,8 @@ static int snd_portman_probe(struct platform_device *pdev) card->private_data = pm; card->private_free = snd_portman_card_private_free; - if ((err = snd_portman_rawmidi_create(card)) < 0) { + err = snd_portman_rawmidi_create(card); + if (err < 0) { snd_printd("Creating Rawmidi component failed\n"); goto __err; } @@ -792,13 +795,15 @@ static int snd_portman_probe(struct platform_device *pdev) pm->pardev_claimed = 1; /* init device */ - if ((err = portman_device_init(pm)) < 0) + err = portman_device_init(pm); + if (err < 0) goto __err; platform_set_drvdata(pdev, card); /* At this point card will be usable */ - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { snd_printd("Cannot register card\n"); goto __err; } @@ -850,7 +855,8 @@ static int __init snd_portman_module_init(void) { int err; - if ((err = platform_driver_register(&snd_portman_driver)) < 0) + err = platform_driver_register(&snd_portman_driver); + if (err < 0) return err; if (parport_register_driver(&portman_parport_driver) != 0) {