From patchwork Thu Jan 7 08:32:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7974581 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 A1FB3BEEE5 for ; Thu, 7 Jan 2016 08:34:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0A312017D for ; Thu, 7 Jan 2016 08:34:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A9BA520103 for ; Thu, 7 Jan 2016 08:34:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id ADEBC2657DF; Thu, 7 Jan 2016 09:34:26 +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 CBA242657E6; Thu, 7 Jan 2016 09:33:17 +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 0AB342657C5; Thu, 7 Jan 2016 09:33:17 +0100 (CET) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by alsa0.perex.cz (Postfix) with ESMTP id 682E1265568 for ; Thu, 7 Jan 2016 09:33:06 +0100 (CET) Received: by mail-pa0-f48.google.com with SMTP id cy9so253261111pac.0 for ; Thu, 07 Jan 2016 00:33:06 -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=ulCI3f80HnxUGuNyJ7Y4hbH+1+QWx4GQ6nPW8fMx4Us=; b=euxkyPiYtfdJ/4yw2srgqZpuQjd0Vw3UwnXCyhGq9EKuubQxYd4Yl+vhSMYj6omKMT EePjtc1H0htwh4SGfLmYqpGHKpet3KN8rkf9sWxtyRqK5yp8os/nrJEGo25r4wcw4zMk RF/LuUCN9E7W/wuM12SowowwFaUY6lZ6WJOzJka+302/vtt02KRo9jLJmpyoArtNhWLo cjo0sDE0imGLDVvv7JZ5cxnmZur3FmXajOcULxXgsxpXbO/ooFyystu60JdBw3PVXEy9 R5oJxdXdQnbKt36jpillbpap8ffgt6Xo3xQPOGlxpdMSrqQPY05Vp/u5yF91bheMiMa6 KiAQ== X-Received: by 10.67.14.3 with SMTP id fc3mr150654026pad.134.1452155585616; Thu, 07 Jan 2016 00:33:05 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.160]) by smtp.gmail.com with ESMTPSA id cq4sm35258802pad.28.2016.01.07.00.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 00:33:04 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Thu, 7 Jan 2016 14:02:46 +0530 Message-Id: <1452155569-6763-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452155569-6763-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1452155569-6763-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 2/5] LSA: mts64: 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/mts64.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 0f91e8e..efecb6e 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -946,7 +946,9 @@ static int snd_mts64_probe(struct platform_device *pdev) return -ENODEV; if (!enable[dev]) return -ENOENT; - if ((err = snd_mts64_probe_port(p)) < 0) + + err = snd_mts64_probe_port(p); + if (err < 0) return err; err = snd_card_new(&pdev->dev, index[dev], id[dev], THIS_MODULE, @@ -973,7 +975,8 @@ static int snd_mts64_probe(struct platform_device *pdev) goto __err; } - if ((err = snd_mts64_create(card, pardev, &mts)) < 0) { + err = snd_mts64_create(card, pardev, &mts); + if (err < 0) { snd_printd("Cannot create main component\n"); parport_unregister_device(pardev); goto __err; @@ -981,7 +984,8 @@ static int snd_mts64_probe(struct platform_device *pdev) card->private_data = mts; card->private_free = snd_mts64_card_private_free; - if ((err = snd_mts64_rawmidi_create(card)) < 0) { + err = snd_mts64_rawmidi_create(card); + if (err < 0) { snd_printd("Creating Rawmidi component failed\n"); goto __err; } @@ -995,13 +999,15 @@ static int snd_mts64_probe(struct platform_device *pdev) mts->pardev_claimed = 1; /* init device */ - if ((err = mts64_device_init(p)) < 0) + err = mts64_device_init(p); + 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; } @@ -1054,7 +1060,8 @@ static int __init snd_mts64_module_init(void) { int err; - if ((err = platform_driver_register(&snd_mts64_driver)) < 0) + err = platform_driver_register(&snd_mts64_driver); + if (err < 0) return err; if (parport_register_driver(&mts64_parport_driver) != 0) {