diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-06-08 16:05:31 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-09 17:30:28 +0200 |
commit | 2073fa449d6d2ac52d511fad4bce121fd284a7f3 (patch) | |
tree | 9aa506d127a35bd3c4f3024b9b3ea4be01e02fea /sound/pcmcia | |
parent | f9a6bb841f737015aface3ba4ac845e66542850e (diff) | |
download | lwn-2073fa449d6d2ac52d511fad4bce121fd284a7f3.tar.gz lwn-2073fa449d6d2ac52d511fad4bce121fd284a7f3.zip |
ALSA: pcmcia: Fix assignment in if condition
PCMCIA VX222 and PDAudioCF drivers contain a few 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-58-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pcmcia')
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 3 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxp_mixer.c | 6 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxp_ops.c | 6 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 3 |
4 files changed, 12 insertions, 6 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 144582350a05..8363ec08df5d 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -170,7 +170,8 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq if (err < 0) return err; - if ((err = snd_card_register(card)) < 0) + err = snd_card_register(card); + if (err < 0) return err; return 0; diff --git a/sound/pcmcia/vx/vxp_mixer.c b/sound/pcmcia/vx/vxp_mixer.c index 0f59e4cca56d..bc2114475810 100644 --- a/sound/pcmcia/vx/vxp_mixer.c +++ b/sound/pcmcia/vx/vxp_mixer.c @@ -124,11 +124,13 @@ int vxp_add_mic_controls(struct vx_core *_chip) /* mic level */ switch (_chip->type) { case VX_TYPE_VXPOCKET: - if ((err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_mic_level, chip))) < 0) + err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_mic_level, chip)); + if (err < 0) return err; break; case VX_TYPE_VXP440: - if ((err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_mic_boost, chip))) < 0) + err = snd_ctl_add(_chip->card, snd_ctl_new1(&vx_control_mic_boost, chip)); + if (err < 0) return err; break; } diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 45eeb0f57d59..4176abd73799 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c @@ -237,9 +237,11 @@ static int vxp_load_dsp(struct vx_core *vx, int index, const struct firmware *fw switch (index) { case 0: /* xilinx boot */ - if ((err = vx_check_magic(vx)) < 0) + err = vx_check_magic(vx); + if (err < 0) return err; - if ((err = snd_vx_load_boot_image(vx, fw)) < 0) + err = snd_vx_load_boot_image(vx, fw); + if (err < 0) return err; return 0; case 1: diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 636320489805..0dfb6a943b60 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -183,7 +183,8 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq chip->irq = irq; card->sync_irq = chip->irq; - if ((err = snd_vx_setup_firmware(chip)) < 0) + err = snd_vx_setup_firmware(chip); + if (err < 0) return err; return 0; |