diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-06-08 17:05:09 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-09 18:30:03 +0300 |
commit | c2b0718f7836b340277eff6f908dbd559ee1a36e (patch) | |
tree | d5d5beacf6d9f6c22760753dbaeffb438ef40df3 /sound/pci/au88x0/au88x0_pcm.c | |
parent | e66fd36264bdffd54a4dc25e42c8f81a4cebb3aa (diff) | |
download | linux-c2b0718f7836b340277eff6f908dbd559ee1a36e.tar.xz |
ALSA: au88x0: Fix assignment in if condition
PCI AU88x0 driver code contains a lot of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.
This patch is merely for coding-style fixes. A potential real fix is
about the PCI AGP bridge management refcount in addition while spotted
out during conversions.
Link: https://lore.kernel.org/r/20210608140540.17885-36-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/au88x0/au88x0_pcm.c')
-rw-r--r-- | sound/pci/au88x0/au88x0_pcm.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index d019aa566de3..546f71220604 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c @@ -130,14 +130,14 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) int err; /* Force equal size periods */ - if ((err = - snd_pcm_hw_constraint_integer(runtime, - SNDRV_PCM_HW_PARAM_PERIODS)) < 0) + err = snd_pcm_hw_constraint_integer(runtime, + SNDRV_PCM_HW_PARAM_PERIODS); + if (err < 0) return err; /* Avoid PAGE_SIZE boundary to fall inside of a period. */ - if ((err = - snd_pcm_hw_constraint_pow2(runtime, 0, - SNDRV_PCM_HW_PARAM_PERIOD_BYTES)) < 0) + err = snd_pcm_hw_constraint_pow2(runtime, 0, + SNDRV_PCM_HW_PARAM_PERIOD_BYTES); + if (err < 0) return err; snd_pcm_hw_constraint_step(runtime, 0, @@ -658,7 +658,8 @@ static int snd_vortex_new_pcm(vortex_t *chip, int idx, int nr) kctl = snd_ctl_new1(&snd_vortex_mixer_spdif[i], chip); if (!kctl) return -ENOMEM; - if ((err = snd_ctl_add(chip->card, kctl)) < 0) + err = snd_ctl_add(chip->card, kctl); + if (err < 0) return err; } } |