From patchwork Thu Nov 16 17:07: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: 10061547 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 64777601AE for ; Thu, 16 Nov 2017 17:08:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C4592AB6A for ; Thu, 16 Nov 2017 17:08:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E9822AB7E; Thu, 16 Nov 2017 17:08:11 +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 578872AB6A for ; Thu, 16 Nov 2017 17:08:10 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 40D9F26774D; Thu, 16 Nov 2017 18:08:09 +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 D0ED926774E; Thu, 16 Nov 2017 18:08:07 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.17.12]) by alsa0.perex.cz (Postfix) with ESMTP id 83BAA266EE4 for ; Thu, 16 Nov 2017 18:08:05 +0100 (CET) Received: from [192.168.1.3] ([78.50.159.33]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lrruc-1fC3o61jPq-013dx3; Thu, 16 Nov 2017 18:07:28 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Arvind Yadav , Jaroslav Kysela , Takashi Iwai , Takashi Sakamoto References: Message-ID: <60be8c64-bbd1-51b7-4ada-60a2f926bf91@users.sourceforge.net> Date: Thu, 16 Nov 2017 18:07: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: Content-Language: en-GB X-Provags-ID: V03:K0:o9lSZybF3vdK5U6KU0fhXHUpXcOUL1tbYg+0qOGnP8+rbhZLvzz XhtGw3FZv4g616kTMlPBgLIvqGfbDZKMNuF1uSYBAlTgP5owvK//jZVXO4Ml1WdbMNfipSh RxwWTG+iZkxLgJo8B65l3WtoYUrdqBYA/JyQ6/Gj/PSsqsoK2xIrHmc8dvZAbAc2o/5ZiMg V53eiPMid+hi8rA7Vd6bw== X-UI-Out-Filterresults: notjunk:1; V01:K0:evnJsMk1C5E=:cYd1sm5kZodx+7Tm0lfazD S1nTCK/3xBY9UhL8TM8fexrs0xTFbtcIJGiIV8gYBSjIXSn7Lj06g3vGRwfTTb1mlQmchGurf nS0sFVltIdAP/RXGEJC71J+a0YUNdnTtkDOgKrwTJwOXpa6zdPnjNzqfr/CyQ6DD3J7b6qjv3 L9eL8AuIS7A2fljgBfBqaYRLAnkoJWEue7FhM6Uf56ZV0dLaq+DCdw6khEL1X26LX8Q1E0UTx WfDHJ7QvzbrLJuk+8LW6YXi4WJGkre56Fhc4dH8UQ+f/CdLCbbSbIG7/ddhtQ3K6pkXdaCPDv 3Qt9lW0wCojpweVIFIWOoG/HCNznPvxicDEgvwYHRocb7LnE220VSzP+XfmxKAUm7g+qTni8g SX+PUOcMpgCPF9NV5YAyBh7QQmbj//XDa3t5P3FHOkMBJAf4EGy/vwPKPqBeoqEWjfm+HL9sl CgumnPMSxH3eh172rljgNx0ssHaL1Jppd/gHLR454h9iqMU4L8Mna8J/8NpZDrBdRg4JoxNb1 KcT5/uw7OG5okVHQT+kXgHY4rpJmHTiDnlwfCsiePXmdwAnBAIymOO1LG8W5c3qGvr5oP0T2o +F+LzJ0SwQmrtSgSS6K3oyinxLt145rW0DaGBDzqejVFn34iD7ZnuMUPfmPUBJG2nIQHemj33 61ow81PRZSv3IZFeCj9Jn+0S06uUczbXCkW4y3LduisGt5yKgrfN4mgtMmpkqlqzznHaKw/Ct rG2qs2E9Y2UPsdGQ654T2xX8NXDRIbGpGvaedQGPDiiUIPRe5Y7N5KUlqclk61iCUOH5nYiWr LQuwLCI7YDzs/M0eu2s4+H16igCsVAnJgMbZfvmNl6TYnl1Kvs= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 1/2] ALSA: nm256: Adjust five 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 17:37:26 +0100 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix affected source code places. Signed-off-by: Markus Elfring --- sound/pci/nm256/nm256.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index b97f4ea6b56c..35ce5b3fd81a 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1334,7 +1334,8 @@ snd_nm256_mixer(struct nm256 *chip) if (! chip->ac97_regs) return -ENOMEM; - if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) + err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); + if (err < 0) return err; memset(&ac97, 0, sizeof(ac97)); @@ -1493,7 +1494,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, *chip_ret = NULL; - if ((err = pci_enable_device(pci)) < 0) + err = pci_enable_device(pci); + if (err < 0) return err; chip = kzalloc(sizeof(*chip), GFP_KERNEL); @@ -1585,7 +1587,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, chip->buffer_end = buffer_top; else { /* get buffer end pointer from signature */ - if ((err = snd_nm256_peek_for_sig(chip)) < 0) + err = snd_nm256_peek_for_sig(chip); + if (err < 0) goto __error; } @@ -1635,7 +1638,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, // pci_set_master(pci); /* needed? */ - 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) goto __error; *chip_ret = chip; @@ -1717,7 +1721,9 @@ static int snd_nm256_probe(struct pci_dev *pci, capture_bufsize = 4; if (capture_bufsize > 128) capture_bufsize = 128; - if ((err = snd_nm256_create(card, pci, &chip)) < 0) { + + err = snd_nm256_create(card, pci, &chip); + if (err < 0) { snd_card_free(card); return err; } @@ -1744,7 +1750,8 @@ static int snd_nm256_probe(struct pci_dev *pci, card->shortname, chip->buffer_addr, chip->cport_addr, chip->irq); - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { snd_card_free(card); return err; }