diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-06-08 16:04:38 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-09 17:29:39 +0200 |
commit | 310efd3aabf2305737b3de2dbdc544d5725e3a52 (patch) | |
tree | 5a422068ac360a2b45d8e29b20583b58b04b1733 /sound/isa/gus/gus_mixer.c | |
parent | ALSA: sb: Fix potential double-free of CSP mixer elements (diff) | |
download | linux-310efd3aabf2305737b3de2dbdc544d5725e3a52.tar.xz linux-310efd3aabf2305737b3de2dbdc544d5725e3a52.zip |
ALSA: gus: Fix assignment in if condition
ISA GUS driver code contains lots 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, no functional changes.
Link: https://lore.kernel.org/r/20210608140540.17885-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/gus/gus_mixer.c')
-rw-r--r-- | sound/isa/gus/gus_mixer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/isa/gus/gus_mixer.c b/sound/isa/gus/gus_mixer.c index 201d0c40d0d9..03f9cfcbf601 100644 --- a/sound/isa/gus/gus_mixer.c +++ b/sound/isa/gus/gus_mixer.c @@ -162,12 +162,14 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus) if (!gus->ics_flag) { max = gus->ess_flag ? 1 : ARRAY_SIZE(snd_gf1_controls); for (idx = 0; idx < max; idx++) { - if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_gf1_controls[idx], gus))) < 0) + err = snd_ctl_add(card, snd_ctl_new1(&snd_gf1_controls[idx], gus)); + if (err < 0) return err; } } else { for (idx = 0; idx < ARRAY_SIZE(snd_ics_controls); idx++) { - if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_ics_controls[idx], gus))) < 0) + err = snd_ctl_add(card, snd_ctl_new1(&snd_ics_controls[idx], gus)); + if (err < 0) return err; } } |