Skip to content

Commit

Permalink
ALSA: pcmcia: Fix assignment in if condition
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jun 9, 2021
1 parent f9a6bb8 commit 2073fa4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion sound/pcmcia/pdaudiocf/pdaudiocf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions sound/pcmcia/vx/vxp_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions sound/pcmcia/vx/vxp_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion sound/pcmcia/vx/vxpocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2073fa4

Please sign in to comment.