From patchwork Tue Nov 14 17:44:32 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: 10058029 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 0CE0F6023A for ; Tue, 14 Nov 2017 17:44:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC07426E3C for ; Tue, 14 Nov 2017 17:44:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E012929819; Tue, 14 Nov 2017 17:44:48 +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 AEA67296D8 for ; Tue, 14 Nov 2017 17:44:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7264E266F72; Tue, 14 Nov 2017 18:44:46 +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 67932266F74; Tue, 14 Nov 2017 18:44:45 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.14]) by alsa0.perex.cz (Postfix) with ESMTP id 695CC266F70 for ; Tue, 14 Nov 2017 18:44:43 +0100 (CET) Received: from [192.168.1.3] ([77.181.57.53]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lex9L-1ezFV70nnT-00qi6W; Tue, 14 Nov 2017 18:44:34 +0100 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Bhumika Goyal , Colin Ian King , David Howells , Jaroslav Kysela , Takashi Iwai References: <8bcf1ada-f44c-cb83-0890-adc8ae8edda0@users.sourceforge.net> Message-ID: Date: Tue, 14 Nov 2017 18:44:32 +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: <8bcf1ada-f44c-cb83-0890-adc8ae8edda0@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:YVztdeWuz3wGCxKI6npjiij2dkFPXmlpVnKjNwOhT4cM4iESb9R K695VV4eZxAf9Bz8GWdqNHrCE19wdgrej/dcgBlIBzI+29HXKXeC5Sx+a4mvx0vOHI15OtZ B5cWITfDu1mqZDaSY+W0e0n0aHTMTN/CwI0820lDgUt5+Ys5DSEse3p+PXC0Z1lF+aLW5oQ FaI3A6rUT8dNkvVLpvE+w== X-UI-Out-Filterresults: notjunk:1; V01:K0:3Td5oVmLBQQ=:GmXgnheHlHsppoxizZxkdD RCZg5m2DR4MdHx+wS/eNME87A5g9SlOGjqhCogx5HvO6BRPzf1uhAquw2eqmmPg5DvfPrSDAf 5QA72TSR1SPl/Uq0B6fUoaLi1rISNeJRGQ4FS77XNWnSZ2MMRJ3XCOuXZ41Hg6Orawo+wLbZG NAILPvVOjtt58ImSshgqRn/810mZYXz4OiZMeL78LUdy/uRUhATUS0KDDXpfBHP55q98ZAZ1d ZQVjrZvRZ+ayshyWK0Mbg9YWv8TIUUWXeS6AwqhdyT0IaMJs8DyAinZWVozYgBJv6UEYOqmgP jnNnYo2PLYkuHyyDvse9KPGl9L/AyHPwlXVP/2P0RR8cgEkluN1/gRUcnhM0HafGNjcr0Vczu Ji2UGzUNpIf9X+CiYiDi5v3ckV4JcaPy9KSIiGvdfk5by/fcU3rfdJu6szZgVL6Cwqb7tDBdr BWfw5RssA9oSrfzYyrBTro3UxB/FYOO+UFJ28Dw5X13xnckcAOa6R1hVT/mLRZHl2Ys7K6rNl XbVaZBcoW/nj3C9ehABssVhFbCNcYV7BGAdMMQsjJikZPUShCpxp1LqY1xiq577f+Zp2lEAbu PJSrNH4EXgATQOi5EoUV8kwSCLSxPfZuYz3as8FQRQJC84nY2/IHzrFvglV1CAG8xj5SL19ao HQ5Y4r9J1par6Sku0uTDIdDgesss2im7Yqoofb+ysstUzvCcTme3+VhHknevrNacaFiy4IeKL zugO28SZT1Sv+HGhXv8BRYA9L3h4Crqsk9SC4lpknF83i0A5J55BkhezkTO7rmK6J/y6SxgJB P9tRs6BeNxFBKFKBaQLjG9hmr5Z+rm9o3zdC3IyESa9Bx8ekSg= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 1/3] ALSA: ens1370: Adjust 15 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: Tue, 14 Nov 2017 18:08:57 +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/ens1370.c | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 39f79a6b5283..7cd7cacdcc28 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -694,7 +694,8 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97, } /* now wait for the stinkin' data (RDY) */ for (t = 0; t < POLL_COUNT; t++) { - if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) { + x = inl(ES_REG(ensoniq, 1371_CODEC)); + if (x & ES_1371_CODEC_RDY) { if (is_ev1938(ensoniq)) { for (t = 0; t < 100; t++) inl(ES_REG(ensoniq, CONTROL)); @@ -1636,7 +1637,8 @@ static int snd_ensoniq_1371_mixer(struct ensoniq *ensoniq, .wait = snd_es1371_codec_wait, }; - if ((err = snd_ac97_bus(card, 0, &ops, NULL, &pbus)) < 0) + err = snd_ac97_bus(card, 0, &ops, NULL, &pbus); + if (err < 0) return err; memset(&ac97, 0, sizeof(ac97)); @@ -1644,7 +1646,8 @@ static int snd_ensoniq_1371_mixer(struct ensoniq *ensoniq, ac97.private_free = snd_ensoniq_mixer_free_ac97; ac97.pci = ensoniq->pci; ac97.scaps = AC97_SCAP_AUDIO; - if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0) + err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97); + if (err < 0) return err; if (has_spdif > 0 || (!has_spdif && es1371_quirk_lookup(ensoniq, es1371_spdif_present))) { @@ -1764,7 +1767,8 @@ static int snd_ensoniq_1370_mixer(struct ensoniq *ensoniq) ak4531.write = snd_es1370_codec_write; ak4531.private_data = ensoniq; ak4531.private_free = snd_ensoniq_mixer_free_ak4531; - if ((err = snd_ak4531_mixer(card, &ak4531, &ensoniq->u.es1370.ak4531)) < 0) + err = snd_ak4531_mixer(card, &ak4531, &ensoniq->u.es1370.ak4531); + if (err < 0) return err; for (idx = 0; idx < ES1370_CONTROLS; idx++) { err = snd_ctl_add(card, snd_ctl_new1(&snd_es1370_controls[idx], ensoniq)); @@ -2088,7 +2092,8 @@ static int snd_ensoniq_create(struct snd_card *card, }; *rensoniq = NULL; - if ((err = pci_enable_device(pci)) < 0) + err = pci_enable_device(pci); + if (err < 0) return err; ensoniq = kzalloc(sizeof(*ensoniq), GFP_KERNEL); if (ensoniq == NULL) { @@ -2100,7 +2105,8 @@ static int snd_ensoniq_create(struct snd_card *card, ensoniq->card = card; ensoniq->pci = pci; ensoniq->irq = -1; - if ((err = pci_request_regions(pci, "Ensoniq AudioPCI")) < 0) { + err = pci_request_regions(pci, "Ensoniq AudioPCI"); + if (err < 0) { kfree(ensoniq); pci_disable_device(pci); return err; @@ -2143,8 +2149,8 @@ static int snd_ensoniq_create(struct snd_card *card, #endif snd_ensoniq_chip_init(ensoniq); - - if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops)) < 0) { + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ensoniq, &ops); + if (err < 0) { snd_ensoniq_free(ensoniq); return err; } @@ -2333,9 +2339,10 @@ static const struct snd_rawmidi_ops snd_ensoniq_midi_input = static int snd_ensoniq_midi(struct ensoniq *ensoniq, int device) { struct snd_rawmidi *rmidi; - int err; + int err = snd_rawmidi_new(ensoniq->card, "ES1370/1", + device, 1, 1, &rmidi); - if ((err = snd_rawmidi_new(ensoniq->card, "ES1370/1", device, 1, 1, &rmidi)) < 0) + if (err < 0) return err; strcpy(rmidi->name, CHIP_NAME); snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_ensoniq_midi_output); @@ -2406,7 +2413,8 @@ static int snd_audiopci_probe(struct pci_dev *pci, if (err < 0) return err; - if ((err = snd_ensoniq_create(card, pci, &ensoniq)) < 0) { + err = snd_ensoniq_create(card, pci, &ensoniq); + if (err < 0) { snd_card_free(card); return err; } @@ -2414,26 +2422,31 @@ static int snd_audiopci_probe(struct pci_dev *pci, pcm_devs[0] = 0; pcm_devs[1] = 1; #ifdef CHIP1370 - if ((err = snd_ensoniq_1370_mixer(ensoniq)) < 0) { + err = snd_ensoniq_1370_mixer(ensoniq); + if (err < 0) { snd_card_free(card); return err; } #endif #ifdef CHIP1371 - if ((err = snd_ensoniq_1371_mixer(ensoniq, spdif[dev], lineio[dev])) < 0) { + err = snd_ensoniq_1371_mixer(ensoniq, spdif[dev], lineio[dev]); + if (err < 0) { snd_card_free(card); return err; } #endif - if ((err = snd_ensoniq_pcm(ensoniq, 0)) < 0) { + err = snd_ensoniq_pcm(ensoniq, 0); + if (err < 0) { snd_card_free(card); return err; } - if ((err = snd_ensoniq_pcm2(ensoniq, 1)) < 0) { + err = snd_ensoniq_pcm2(ensoniq, 1); + if (err < 0) { snd_card_free(card); return err; } - if ((err = snd_ensoniq_midi(ensoniq, 0)) < 0) { + err = snd_ensoniq_midi(ensoniq, 0); + if (err < 0) { snd_card_free(card); return err; } @@ -2449,7 +2462,8 @@ static int snd_audiopci_probe(struct pci_dev *pci, ensoniq->port, ensoniq->irq); - if ((err = snd_card_register(card)) < 0) { + err = snd_card_register(card); + if (err < 0) { snd_card_free(card); return err; }