From patchwork Thu Feb 4 16:46:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8225371 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 58BBD9F1C0 for ; Thu, 4 Feb 2016 16:48:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E55620392 for ; Thu, 4 Feb 2016 16:48:05 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 34D8B20142 for ; Thu, 4 Feb 2016 16:48:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4C26826659E; Thu, 4 Feb 2016 17:48:03 +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 41FC82660EE; Thu, 4 Feb 2016 17:47:04 +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 E516F266168; Thu, 4 Feb 2016 17:47:02 +0100 (CET) Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by alsa0.perex.cz (Postfix) with ESMTP id 33AE7261AA1 for ; Thu, 4 Feb 2016 17:46:52 +0100 (CET) Received: by mail-pf0-f175.google.com with SMTP id w123so50517359pfb.0 for ; Thu, 04 Feb 2016 08:46:52 -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=j63kztaWKn/DAV90gXBf6ChW4XAl1iMKLQER6we+IEU=; b=EjGO/NUZbO0gToAn9f+oiM+AdFB4EyfYWirGfKgrv59T4xoAHi+B996YStUpXsuLsn 03rGAgTfEhvi2tewQf85pdAeWdIw5c/NbykUXO2/E8YQJ5mPYds/1zChSpuhI+TQhVLR 4M9be30BCAOGTy6qGxiOYcelyS5pJ0wpwGSWCT9xgJB2tcFcuGRKYFTCxE58Fk8RZtTm Eha9hXzCeoievGhNPbnjnQ09GsIqOQB+qU58hZCrSs/lCsiQPy8ODm1K93sP6lIp5t31 QhMMVGWSUvHpSS+Om3iHqVUooev3Y+F8kIuBjwLsGz1ZfH6/hRWdbfF64HimmQ8L6EO4 4PJw== 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=j63kztaWKn/DAV90gXBf6ChW4XAl1iMKLQER6we+IEU=; b=NV3tIoDRQPxsBJAYosl8yae/SlvLswjfZaKf4vcrrG0lkyBDa9uq6OlvbRwepiDMFq uQIJkxvibEzwr1RIZxE4cVPXPpC0H2Fwxg/b+DHHZxSBCqemVwYfdnfzKY7TQyUGf5kW 9xhtGEBfNgs1WkCbimtWWLESrrnQQymDpZTLrHb4EP+ZufnB1vaCT2lCJvVa0mLkNV6Y aqAl+Jp5Cy42dBTwAQ2g3VkPt9XBEVd3LNHsiRHw6OUwevu9ctaPkhZzVLbJ21NoTvIE UqTDW3V0MGo2DHgG8AvzYCokvAE1pHnT9WRH2gzZEwfcaDHlUbxN+Zjjj64rOLSROkOe FLVg== X-Gm-Message-State: AG10YOSrEH6sy1jBWBEcrns0gM9DzOiPmtg6T7maOQQIC6epZYhJY4JiFy9JzDSZxkyJxg== X-Received: by 10.98.12.221 with SMTP id 90mr12389340pfm.95.1454604411543; Thu, 04 Feb 2016 08:46:51 -0800 (PST) Received: from localhost.localdomain ([103.24.124.194]) by smtp.gmail.com with ESMTPSA id dg1sm18367498pad.18.2016.02.04.08.46.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 08:46:51 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Thu, 4 Feb 2016 22:16:33 +0530 Message-Id: <1454604394-16055-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454604394-16055-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1454604394-16055-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] ALSA: 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 --- v3: no change v2: no change 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 f7d938d..ee6a87f 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -943,7 +943,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, @@ -970,7 +972,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; @@ -978,7 +981,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; } @@ -992,13 +996,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; } @@ -1050,7 +1056,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) {