From patchwork Thu Nov 16 11:51:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10061009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DEDB604D4 for ; Thu, 16 Nov 2017 12:00:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82A992A672 for ; Thu, 16 Nov 2017 12:00:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 778852A9B4; Thu, 16 Nov 2017 12:00:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 868452A9B3 for ; Thu, 16 Nov 2017 12:00:49 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B31952670E5; Thu, 16 Nov 2017 12:52:08 +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 257872670F4; Thu, 16 Nov 2017 12:52:07 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.17.11]) by alsa0.perex.cz (Postfix) with ESMTP id 2E1AC266EE4 for ; Thu, 16 Nov 2017 12:52:04 +0100 (CET) Received: from [192.168.1.3] ([78.50.159.33]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LyUsk-1fIlVO2PAs-015qWZ; Thu, 16 Nov 2017 12:51:28 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Alexey Dobriyan , Andrew Morton , Bhumika Goyal , Jaroslav Kysela , Kees Cook , Takashi Iwai References: <3f68211d-51f0-2990-d711-44eaeb85ba4d@users.sourceforge.net> Message-ID: <029bd28a-1691-58d8-e1e8-56ae4f189439@users.sourceforge.net> Date: Thu, 16 Nov 2017 12:51:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <3f68211d-51f0-2990-d711-44eaeb85ba4d@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:IeeSZcvWHtx0+9AtwaY9Gnts8EqfqV50JiYpiusB5jP+bRt7uUA 0hf5zxUjmOwuEMPLyMwp9Mh/c69IY6DOUPx8Rgl+j3o1T0detm5+ZUr6eXHTA8RnTUC3VSC CJQ8Fhw0NgX55hczutSlUEH5S18csXSKso9KiambhE63mV4Zg32DCDzQNtOAAV4RP0b+cSl AlyJ0bY9Nt6yT/vBj+arw== X-UI-Out-Filterresults: notjunk:1; V01:K0:gWuowQwtJ9o=:M/s/ZkAUqxHPBWduxGjFS8 V3CDRNPBE01GP2hlM1qByk2vV8JpMjvrh98S9HTnTrePVUWKtQtsEhKDiDr9ew403Ehyj/7O9 LWSI89OHB1xBmg/g6Wtkb1Zg4XjOuWYYpQxpFhGd/JX9HlEUaw1HCIsoa/HB3m6Ed6WyGGcLE 1v33dxx/DjAPmGcImC8EpKCUQ3IQ14hcE1KkGd+N7G84Eu8CR5ZmjbsqmPNHJI6XcwJeNQrYz G2OGGr+/vjITr0XnNc9lxhwKAsILo8hSwDNHyAwdU21ugRf+v2/mxXm9Rd/w8/OsQn6miie8w OiGfwWer2bHvQdP51k1Nzn7J9SO6Umrf5XJKtt0jb9jct+FwX0I+HdvHz4cAzbfa1k1dBbq7s 5k4UNY1YXhUTRl5mkqIq9MhiGbp3KeDWCAp8inIdwAJCISBo7qe4TX6kf3qV6zklHgEYFFkqV c05t0Ra83SHLSmUApy4AZsa5bhqFoWct44ZwOSbwODXt8lwh8zWGqnO/XxGwivJBwYpUnSimM t7HsdO2sWqTl5Q8C4KZ3PUX9dsmeXFwFVhrkL2zHvQ1guwlorjPc0/pN0Uc0U47K6XkOQyIo0 MCNt0pMXbIRuk9Xot9tZKtG2JWjTV65wCKo/kmftahfwPw59HP00UnK7P2PPOCdKl7GLUe6Nu uHrjpvlTXc6ClaeNb4sQbzLLuMdC8kwIWO61tyxdZvDsSE43GgVXtwp+HuYAVzY61cVWDf/di X0qS6FWlJs4/AM9A2c5BCbOR25PwhiIcnUtOjaVe0qtgp9FAF//4DMMP+Dhsq9HOQBjhA2iJB FEuNOqnYCHfOOUGDGV8p1i0hbsO1ADhynboPcASeNFXWjGeVFs= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 1/3] ALSA: korg1212: Adjust eight function calls together with a variable assignment 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 16 Nov 2017 09:42:45 +0100 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code places. Signed-off-by: Markus Elfring --- sound/pci/korg1212/korg1212.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index c7b007164c99..6dde8c215b48 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -1542,7 +1542,8 @@ static int snd_korg1212_hw_params(struct snd_pcm_substream *substream, return 0; } - if ((err = snd_korg1212_SetRate(korg1212, params_rate(params))) < 0) { + err = snd_korg1212_SetRate(korg1212, params_rate(params)); + if (err < 0) { spin_unlock_irqrestore(&korg1212->lock, flags); return err; } @@ -2174,8 +2175,9 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, }; * rchip = NULL; - if ((err = pci_enable_device(pci)) < 0) - return err; + err = pci_enable_device(pci); + if (err < 0) + return err; korg1212 = kzalloc(sizeof(*korg1212), GFP_KERNEL); if (korg1212 == NULL) { @@ -2211,7 +2213,8 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, for (i=0; ivolumePhase[i] = 0; - if ((err = pci_request_regions(pci, "korg1212")) < 0) { + err = pci_request_regions(pci, "korg1212"); + if (err < 0) { kfree(korg1212); pci_disable_device(pci); return err; @@ -2235,7 +2238,8 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, korg1212->iomem2, iomem2_size, stateName[korg1212->cardState]); - if ((korg1212->iobase = ioremap(korg1212->iomem, iomem_size)) == NULL) { + korg1212->iobase = ioremap(korg1212->iomem, iomem_size); + if (!korg1212->iobase) { snd_printk(KERN_ERR "korg1212: unable to remap memory region 0x%lx-0x%lx\n", korg1212->iomem, korg1212->iomem + iomem_size - 1); snd_korg1212_free(korg1212); @@ -2375,7 +2379,8 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, if (rc) K1212_DEBUG_PRINTK("K1212_DEBUG: Reboot Card - RC = %d [%s]\n", rc, stateName[korg1212->cardState]); - if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, korg1212, &ops)) < 0) { + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, korg1212, &ops); + if (err < 0) { snd_korg1212_free(korg1212); return err; } @@ -2400,8 +2405,9 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, korg1212->RoutingTablePhy, LowerWordSwap(korg1212->RoutingTablePhy), korg1212->AdatTimeCodePhy, LowerWordSwap(korg1212->AdatTimeCodePhy)); - if ((err = snd_pcm_new(korg1212->card, "korg1212", 0, 1, 1, &korg1212->pcm)) < 0) - return err; + err = snd_pcm_new(korg1212->card, "korg1212", 0, 1, 1, &korg1212->pcm); + if (err < 0) + return err; korg1212->pcm->private_data = korg1212; korg1212->pcm->private_free = snd_korg1212_free_pcm; @@ -2451,7 +2457,8 @@ snd_korg1212_probe(struct pci_dev *pci, if (err < 0) return err; - if ((err = snd_korg1212_create(card, pci, &korg1212)) < 0) { + err = snd_korg1212_create(card, pci, &korg1212); + if (err < 0) { snd_card_free(card); return err; } @@ -2463,7 +2470,8 @@ snd_korg1212_probe(struct pci_dev *pci, K1212_DEBUG_PRINTK("K1212_DEBUG: %s\n", card->longname); - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { snd_card_free(card); return err; }