From patchwork Thu Nov 16 21:26:08 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: 10062119 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 95ADC6023A for ; Thu, 16 Nov 2017 21:26:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 853C92ABFB for ; Thu, 16 Nov 2017 21:26:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78B3C2AC0A; Thu, 16 Nov 2017 21:26:20 +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=ham 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 627452ABFB for ; Thu, 16 Nov 2017 21:26:19 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B1BE82671EB; Thu, 16 Nov 2017 22:26: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 6C5372671EB; Thu, 16 Nov 2017 22:26:17 +0100 (CET) Received: from mout.web.de (mout.web.de [217.72.192.78]) by alsa0.perex.cz (Postfix) with ESMTP id D1128266EE4 for ; Thu, 16 Nov 2017 22:26:15 +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 0LshKH-1fDMoV0DiD-012FDV; Thu, 16 Nov 2017 22:26:10 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Arnd Bergmann , Bhumika Goyal , Jaroslav Kysela , Takashi Iwai References: Message-ID: <41a0e34c-d3b5-c9d9-1827-9977e084bd0f@users.sourceforge.net> Date: Thu, 16 Nov 2017 22:26:08 +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: Content-Language: en-GB X-Provags-ID: V03:K0:HJjNIOPdeNPCHJ9bfr9NUfQvrCq8FemCuVOaFuVxWGHLrvjaAX0 hjFgwVvZDlYiVIz5yR7AEa5r3Q/jPRrpVOtvEKrulDpOGgB+UcXF9hEIIEfLJVgffAOslkx lWTnKc7TCR6gVfn1vAH1zgReJfI+IPJP7V3jvxcksyZP6/AVxtlNfhoprZDeJy3mCwIHhVY hhm9PELB51cWe4myB9vbQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:mf1kGTztA08=:9m46vZqfwVuKGF5urvoBsk cTNE3toIiqVQLqgXeEYatdM9F4ZSbxaezdG0Yz3+5XuU3qdUMJWYgYadtd4Jj0FBN5VuotIte etEC3P6VFIgLqy+0vxukT2pvPtm1FHsk/Sb+Ggw9MUco7a+LV3BEsvuxfpdMdwbcL0hcoaLnD YxDthDIEq8KlPRh0Yd/N5DeyidD3p1uoHczOr/x1Y0HhGG1GZBRHwKi7U16Q6WIMMzgdZHIOe 1fgsKzcoZpEqJrKZAihJ1ywbcvtmkHZAWGCGRNad2mz6aZZBfmPIMUss660VAcYNKbqJfmayC 03fsEqMD5qpqxSgQlaSDWjm7GyEiCs/HCeToQCpNcmGtEBJNiVtskYADbSVaUi5Hl7VWhbsqu 2CjttEBvJvUHNBcTKfJ1rvqQeDB0AEm87tx+88sP7iI+LcEwIAJwFtnzriYvFRrosrtVVB3pH lVomc5k/HY/pMmymUQE01G+5fkOXOpCLTw7cVa05XRn5AQI6BUue4kam7OH8zMlmUKV2eNQxd 4S28LPOeMclmOsvmaLJuyj/zsd6ToAsIzNc6hx1wwqfaNWxQGgnXFcCkrfod+fAmwiPhNf6WH dBoNdvx4CooSTYoTjck/LPgtIH1YmHKiiUmim4rALBXYqXGuHNihAxfwC9ziqGeJOBvR1K/Rr mOPDqs/esWhri/jQ4KR3nsEa9PRX68C6/GXHN6uFVEvF/YUjtneB0jYKpPiQv8GdKfYl2NUn6 KXrpZrqE4gK7N4XTK+YGJSBcg+VhoT8G4rytnKZre6Vx1Rs9l0ANpjowPhbwyPUArUfQ9u+cx TPowFcS0B0oEt7BWWepwwPOj3e4mA1G/e4xI6k8lHwCaX+5FdE= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 1/2] ALSA: pcxhr: Adjust six 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 21:50:21 +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/pcxhr/pcxhr.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index f9ae72f28ddc..c490d7e57ff7 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -1166,9 +1166,10 @@ int pcxhr_create_pcm(struct snd_pcxhr *chip) char name[32]; snprintf(name, sizeof(name), "pcxhr %d", chip->chip_idx); - if ((err = snd_pcm_new(chip->card, name, 0, - chip->nb_streams_play, - chip->nb_streams_capt, &pcm)) < 0) { + err = snd_pcm_new(chip->card, name, 0, + chip->nb_streams_play, + chip->nb_streams_capt, &pcm); + if (err < 0) { dev_err(chip->card->dev, "cannot create pcm %s\n", name); return err; } @@ -1233,7 +1234,8 @@ static int pcxhr_create(struct pcxhr_mgr *mgr, chip->nb_streams_capt = 1; /* or 1 stereo stream */ } - if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); + if (err < 0) { pcxhr_chip_free(chip); return err; } @@ -1530,7 +1532,8 @@ static int pcxhr_probe(struct pci_dev *pci, } /* enable PCI device */ - if ((err = pci_enable_device(pci)) < 0) + err = pci_enable_device(pci); + if (err < 0) return err; pci_set_master(pci); @@ -1575,7 +1578,8 @@ static int pcxhr_probe(struct pci_dev *pci, mgr->granularity = PCXHR_GRANULARITY; /* resource assignment */ - if ((err = pci_request_regions(pci, card_name)) < 0) { + err = pci_request_regions(pci, card_name); + if (err < 0) { kfree(mgr); pci_disable_device(pci); return err; @@ -1646,7 +1650,8 @@ static int pcxhr_probe(struct pci_dev *pci, snprintf(card->longname, sizeof(card->longname), "%s [PCM #%d]", mgr->name, i); - if ((err = pcxhr_create(mgr, card, i)) < 0) { + err = pcxhr_create(mgr, card, i); + if (err < 0) { snd_card_free(card); pcxhr_free(mgr); return err; @@ -1656,7 +1661,8 @@ static int pcxhr_probe(struct pci_dev *pci, /* init proc interface only for chip0 */ pcxhr_proc_init(mgr->chip[i]); - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { pcxhr_free(mgr); return err; }