From patchwork Sat Jan 30 10:18:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8170551 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 2B08CBEEE5 for ; Sat, 30 Jan 2016 10:19:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A8BD203A1 for ; Sat, 30 Jan 2016 10:19:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0B6282039E for ; Sat, 30 Jan 2016 10:19:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1E72B265FDA; Sat, 30 Jan 2016 11:19: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, NO_DNS_FOR_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 C4094261AE4; Sat, 30 Jan 2016 11:18:47 +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 430E9261ACD; Sat, 30 Jan 2016 11:18:45 +0100 (CET) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by alsa0.perex.cz (Postfix) with ESMTP id D0973261AA3 for ; Sat, 30 Jan 2016 11:18:37 +0100 (CET) Received: by mail-pf0-f193.google.com with SMTP id n128so4961634pfn.3 for ; Sat, 30 Jan 2016 02:18:37 -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=yRh5zi4qAJgwSXrds3NuqHkXeVbeMAFWiYBkmvegTas=; b=ZdXToWZ3Wy5YTlrzr5rptJyJItu49WkL0gzJF8vPBDrn/6XTRl+hqzVl4wiKK6g2UJ AUtXS9l5+bHD/8w+l0sser1pdUSHSRUhMQBgmhS03pkcYKKy+Qx8idBU4QxLwbtOPGL8 RxNR0W0cs5oz3G4SzPs1y+ajY1jipaM/TwDUF/T2B85Jyejw9Hu0dOfUvlPrpjpCRb47 xlYU81WkipQkAXg4NE0Dpg6JL0Rp3/Y8yLep4slzBK0nZWrbUbO4ktvnauyIjN/z7XOa L0GqZk6bDsnPivCm3Ql0QZE7SaTvmvOUk0TCuCpteMYI1oAcegQU9lXNLWq/+JRVWnb3 HSOg== 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=yRh5zi4qAJgwSXrds3NuqHkXeVbeMAFWiYBkmvegTas=; b=GUt/5vwDOeZTQgSO1xP9MjayM55ZWoUrtNgX96DsDQeYcvq9hcTrEYS8yQ+H5yLzuv 7Y2FcZg60LQ8OIc7KtNd/l/q6e7xcJJNu7PIeapwx+M3qTlyGe44TF/t/Jt52MWV3hdh FuYYLWaoD6AoGW5VBWqQgZen3MKFSMOHQaNsiYNB3ibBx2e9K5+amgIOo5qaBXbG7IRW KL4eXiSbnDifg8cEk3hqMXbaBoQe8FOiyw2Hczt+w/mjZhwJz752mtLDph/mOk+l3qcB jFiEh4AW3F5sBKO1XcK0ovgEZrlHcZjS/mvwFy1jWHB2r3wEezsVxsJ23JfGZBJzuZ/Z PnJg== X-Gm-Message-State: AG10YOR2D1m8AamC39nyCmO5rKaMJglpCWtlha4vNof76bpaZEmD3aMtC4/kPNzfjnrYNg== X-Received: by 10.98.64.195 with SMTP id f64mr21166155pfd.103.1454149117186; Sat, 30 Jan 2016 02:18:37 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.136]) by smtp.gmail.com with ESMTPSA id s19sm29335561pfs.62.2016.01.30.02.18.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Jan 2016 02:18:36 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Sat, 30 Jan 2016 15:48:24 +0530 Message-Id: <1454149105-17474-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454149105-17474-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1454149105-17474-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 v2 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 --- 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) {