From patchwork Thu Feb 4 16:38:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8225271 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 099D99F6DA for ; Thu, 4 Feb 2016 16:40:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 365FD20389 for ; Thu, 4 Feb 2016 16:40:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EC0B3201CD for ; Thu, 4 Feb 2016 16:40:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D6E722661BF; Thu, 4 Feb 2016 17:40:08 +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 24E312660C2; Thu, 4 Feb 2016 17:39:11 +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 4E3F8266323; Thu, 4 Feb 2016 17:39:10 +0100 (CET) Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by alsa0.perex.cz (Postfix) with ESMTP id 0B9872660C2 for ; Thu, 4 Feb 2016 17:38:37 +0100 (CET) Received: by mail-pf0-f170.google.com with SMTP id w123so50295909pfb.0 for ; Thu, 04 Feb 2016 08:38:36 -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=8/fGt5Rst9Qsl5GSwudEFpd9QtBH0UDg8KPgxN+atJ4=; b=iw3njjbhoU0bZNs36rUjAoYu+BpLilQ/tRRtRHK8nKx1fUqGF5RBrL3v47NIv+5u24 lCdfr5FaHUqJGyAzL9Ur1Qo1rcemwXHCb+86u2rusu3GVo4ZR6fr3sYXPs6iRctXci6f HpXEhGgFslb+ApBMjIwy3Msdcz2Cs8CAZ2q/+7Lk6xlScN8SEq/C0Rpgwx43INyHgKW0 GXkBjku645KU+t+UN1t3iJbLkjHCt1t1tBpTviIJaXmPWiiMibbLvUo595FgI5VbUa9+ XOrsWVrX6vLXNcCv2KgUaGQjJOybU9sgGZJ8rfV7CB2gJeOIzgg7u8XUbOnk+So50CRP 349Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8/fGt5Rst9Qsl5GSwudEFpd9QtBH0UDg8KPgxN+atJ4=; b=JilBxBH68FDMmcimza1s/3jEa3fE08SBuHFhMu/vdsI8Vdkfs7G4EWbUNZ5KGdjFfQ DKTNSB6KPWJwM5eiBPy8CKgC/vKX2Tc0vMGm0UIyXzNo3S4BhE98Mjf3hjBBnHYRHxbI ahT5ix0mvvwlyZN3Yn18KuxUjORlYQUBasY0VX1Um/FaQN0JCF32bsuy35cFG38Ua92G 9nuE68FZR2MrSCz22cz7AL7TkE7c3aOknnMBSs3PitSnVmXXc+VEo7TRs/KRuVwLKZyh mCIBYmm2BbwgRshY6pAu5WXJNImrPBnv5bjIX/oEa5EV0zahssTlCp1zrXxTjJ3VKNop jXaw== X-Gm-Message-State: AG10YOQDdrvqfqgeMzq8dKk6aLKlEW2man7HRA3OkQ+JKy/WNQv+duWq+sqhGnS+GZoWTw== X-Received: by 10.66.102.40 with SMTP id fl8mr12333721pab.136.1454603915655; Thu, 04 Feb 2016 08:38:35 -0800 (PST) Received: from localhost.localdomain ([103.24.124.194]) by smtp.gmail.com with ESMTPSA id g81sm18386561pfj.1.2016.02.04.08.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 08:38:35 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Thu, 4 Feb 2016 22:08:22 +0530 Message-Id: <1454603903-15967-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454603903-15967-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1454603903-15967-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 v3 2/3] 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 --- v3: no change v2: no change 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 65b0650..172685d 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) {