diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-06-08 16:05:28 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-09 17:30:24 +0200 |
commit | 137c171cf7ecf624e067d800dca6cbeffb8cc73d (patch) | |
tree | d7b414d7a32654d19988e05aa83bb39583381017 /sound/core/pcm_compat.c | |
parent | e3ded899667731b7b590016adeb7b5948fdcd658 (diff) | |
download | linux-stable-137c171cf7ecf624e067d800dca6cbeffb8cc73d.tar.gz linux-stable-137c171cf7ecf624e067d800dca6cbeffb8cc73d.tar.bz2 linux-stable-137c171cf7ecf624e067d800dca6cbeffb8cc73d.zip |
ALSA: pcm: Fix assignment in if condition
There are a few places doing assignments in if condition in ALSA PCM
core code, which is a bad coding style that may confuse readers and
occasionally lead to bugs.
This patch is merely for coding-style fixes, no functional changes.
Link: https://lore.kernel.org/r/20210608140540.17885-55-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/pcm_compat.c')
-rw-r--r-- | sound/core/pcm_compat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 590a46a9e78d..a59de24695ec 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -239,7 +239,8 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime; int err; - if (! (runtime = substream->runtime)) + runtime = substream->runtime; + if (!runtime) return -ENOTTY; data = kmalloc(sizeof(*data), GFP_KERNEL); @@ -343,7 +344,8 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream, if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) return -EBADFD; - if ((ch = substream->runtime->channels) > 128) + ch = substream->runtime->channels; + if (ch > 128) return -EINVAL; if (get_user(buf, &data32->bufs) || get_user(frames, &data32->frames)) |