summaryrefslogtreecommitdiff
path: root/sound/synth/emux/emux_effect.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-06-08 16:05:37 +0200
committerTakashi Iwai <tiwai@suse.de>2021-06-09 17:30:35 +0200
commitdd1fc3c585dddf0f8d1baaa941395aa4afdfa724 (patch)
treeb2636b6a3658fff9e66046cdbdf4b5b7005f0e1d /sound/synth/emux/emux_effect.c
parentd0ad13ef704164cf41b5f38d3c9e87dd8f67b5bb (diff)
ALSA: synth: Fix assignment in if condition
EMUx synth 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-64-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/synth/emux/emux_effect.c')
-rw-r--r--sound/synth/emux/emux_effect.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c
index afd119b11f39..3c7314f5fb19 100644
--- a/sound/synth/emux/emux_effect.c
+++ b/sound/synth/emux/emux_effect.c
@@ -181,7 +181,10 @@ snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan,
fx->flag[type] = mode;
/* do we need to modify the register in realtime ? */
- if (! parm_defs[type].update || (offset = parm_defs[type].offset) < 0)
+ if (!parm_defs[type].update)
+ return;
+ offset = parm_defs[type].offset;
+ if (offset < 0)
return;
#ifdef SNDRV_LITTLE_ENDIAN
@@ -223,13 +226,17 @@ snd_emux_setup_effect(struct snd_emux_voice *vp)
unsigned char *srcp;
int i;
- if (! (fx = chan->private))
+ fx = chan->private;
+ if (!fx)
return;
/* modify the register values via effect table */
for (i = 0; i < EMUX_FX_END; i++) {
int offset;
- if (! fx->flag[i] || (offset = parm_defs[i].offset) < 0)
+ if (!fx->flag[i])
+ continue;
+ offset = parm_defs[i].offset;
+ if (offset < 0)
continue;
#ifdef SNDRV_LITTLE_ENDIAN
if (parm_defs[i].type & PARM_IS_ALIGN_HI)