From patchwork Tue Jan 24 10:27:19 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: 9535251 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 0D1A96042C for ; Tue, 24 Jan 2017 13:53:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E51DE2807E for ; Tue, 24 Jan 2017 13:53:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C443F280F4; Tue, 24 Jan 2017 13:53:45 +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 7DF2A20243 for ; Tue, 24 Jan 2017 13:53:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AF0112673D3; Tue, 24 Jan 2017 14:53:42 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3921E266D09; Tue, 24 Jan 2017 14:51:22 +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 4ED61266A12; Tue, 24 Jan 2017 11:27:26 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.17.12]) by alsa0.perex.cz (Postfix) with ESMTP id 08DD42668C0 for ; Tue, 24 Jan 2017 11:27:23 +0100 (CET) Received: from [192.168.1.2] ([77.181.182.246]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M8hsl-1cIAvp0XDf-00wC0D; Tue, 24 Jan 2017 11:27:22 +0100 To: alsa-devel@alsa-project.org, Clemens Ladisch , Jaroslav Kysela , Martin Koegler , Takashi Iwai , Takashi Sakamoto References: From: SF Markus Elfring Message-ID: <43a0c4d3-d054-4be2-eab7-7ee37b62fca6@users.sourceforge.net> Date: Tue, 24 Jan 2017 11:27:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:Qw9IUeTyzVXI2w8Qj9l+/GBn+S/HZG+9GsWfck33lyCCMr1fG6z YiOMLnqaZDLVViNy9dr4QDxFeiGRKtQmLK5lIn8WeN3VzURh5vyO+aPfPt9mE7RcM+4cO3a 9GgSp4KvfsdAG8t29WXwDS6q5qDqFIlS9TrbJi2gqfG/+agP1QnWrivXGZt6klUQ2lbDeD/ qR5ZQ9+oFwZv5NMXZyWvQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:/nzA+uuTm5k=:Psd08lQsGBmRXkAYGMeX+Y UrEXO/xRtXWQlCyn6NloTIFz4kSp94E48IZHIFuGF503lYnT4kpjOsEFLSrW07cPRhMbFM5mq oT4paux8KsIOV2LEo+0PEFThssy2Q/qchm1hH27aEM/aUluIyCt+xRDAdd19oyJUgtZzuF0Oy 6u5EV/tgbUVpeQZIDLLFqcR4ssRnMAH3QWDvySebrGCkKzlsgEG+s+y85wfLlmzD/L3ee9YZZ lfBeASAkEWKT3dGUkV1auPSqiW+nJ6WYmjfp+rt/aL0tOFiKufrKpYwB3FywiN4aqK9uC/Onz DXMqOYLVOvt1aGuXjwGlqPPDmvC5z648UXjrcC5HYfmqfsJKDJZuuT+d6WgezRsEfm1wSxhdV jHY5iViY8rJi69CQmI8NzqhvEDg/0AYRJDYf7SulCa9AQvEZ03G0t+IY6ZqAFb/TV8fpoe5Bj mGtfEjL1EFIMAjao8k7aiJm7NDIoc9JdM8YCsVDX1BUXt2zDtoO+rzrdfk8raAaQk2HKoE5d0 d2nA68yM68+HmmJgNlD3Cf9HXj9zRBoOmnoWOy/kILXQW/VsZeOlyY6+b7RaoVNf01MCxg0Pk 2W1M6yHMo3eDlXkN40Ck45xmnSC0i+LDkN4290AXhOfaTMyvpsMWNJIKo8RyBNL5ylJZQm6Cg SSZ5WQvlZdH6ksvYRegR1WnjVIZfpRvUYtJdWE3ba6idmymp9DIIpf2gIKoDSY2RWNaJLPCkB lQAAliFW6aygxubcD/CtvLCQOn9uNkj3e+ZAauu7Bi481z1IyFa2fHHHPr4K1JaquhdpOQohn 16G+e5M Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 7/7] dmasound_core: 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: Tue, 24 Jan 2017 10:34:47 +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/oss/dmasound/dmasound_core.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c index 2bdd1d619a7f..a20bf3b94329 100644 --- a/sound/oss/dmasound/dmasound_core.c +++ b/sound/oss/dmasound/dmasound_core.c @@ -576,7 +576,9 @@ static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft, */ if (write_sq.locked == 0) { - if ((uWritten = sq_setup(&write_sq)) < 0) return uWritten ; + uWritten = sq_setup(&write_sq); + if (uWritten < 0) + return uWritten; uWritten = 0 ; } @@ -675,7 +677,8 @@ static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait) int retVal; if (write_sq.locked == 0) { - if ((retVal = sq_setup(&write_sq)) < 0) + retVal = sq_setup(&write_sq); + if (retVal < 0) return retVal; return 0; } @@ -736,7 +739,8 @@ static int sq_open2(struct sound_queue *sq, struct file *file, fmode_t mode, can't be changed at the moment - but _could_ be perhaps in the setfragments ioctl. */ - if (( rc = sq_allocate_buffers(sq, numbufs, bufsize))) { + rc = sq_allocate_buffers(sq, numbufs, bufsize); + if (rc) { #if 0 /* blocking open() */ sq_wake_up(sq, file, mode); #else @@ -1407,12 +1411,14 @@ int dmasound_init(void) /* Set up sound queue, /dev/audio and /dev/dsp. */ /* Set default settings. */ - if ((res = sq_init()) < 0) - return res ; + res = sq_init(); + if (res < 0) + return res; /* Set up /dev/sndstat. */ - if ((res = state_init()) < 0) - return res ; + res = state_init(); + if (res < 0) + return res; /* Set up /dev/mixer. */ mixer_init(); @@ -1485,7 +1491,8 @@ static int dmasound_setup(char *str) numWriteBufs = ints[1]; /* fall through */ case 1: - if ((size = ints[2]) < 256) /* check for small buffer specs */ + size = ints[2]; + if (size < 256) /* check for small buffer specs */ size <<= 10 ; if (size < MIN_BUFSIZE || size > MAX_BUFSIZE) printk("dmasound_setup: invalid write buffer size, using default = %d\n", writeBufSize);