diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-06-08 16:05:14 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-06-09 17:30:11 +0200 |
commit | 12bda1076c76c87d40fbd9d5dfa5ddf6f60a1772 (patch) | |
tree | c8cf41f49f8873614ab2c2df611609f1642190b4 /sound/pci/emu10k1/emu10k1.c | |
parent | ALSA: echoaudio: Fix assignment in if condition (diff) | |
download | linux-12bda1076c76c87d40fbd9d5dfa5ddf6f60a1772.tar.xz linux-12bda1076c76c87d40fbd9d5dfa5ddf6f60a1772.zip |
ALSA: emu10k1: Fix assignment in if condition
PCI EMU10k1 driver code contains 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-41-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1.c')
-rw-r--r-- | sound/pci/emu10k1/emu10k1.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index 45833bc2a7e7..887bfb3c1e17 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c @@ -107,18 +107,22 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci, max_buffer_size[dev] = 32; else if (max_buffer_size[dev] > 1024) max_buffer_size[dev] = 1024; - if ((err = snd_emu10k1_create(card, pci, extin[dev], extout[dev], - (long)max_buffer_size[dev] * 1024 * 1024, - enable_ir[dev], subsystem[dev], - &emu)) < 0) + err = snd_emu10k1_create(card, pci, extin[dev], extout[dev], + (long)max_buffer_size[dev] * 1024 * 1024, + enable_ir[dev], subsystem[dev], + &emu); + if (err < 0) goto error; card->private_data = emu; emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f; - if ((err = snd_emu10k1_pcm(emu, 0)) < 0) + err = snd_emu10k1_pcm(emu, 0); + if (err < 0) goto error; - if ((err = snd_emu10k1_pcm_mic(emu, 1)) < 0) + err = snd_emu10k1_pcm_mic(emu, 1); + if (err < 0) goto error; - if ((err = snd_emu10k1_pcm_efx(emu, 2)) < 0) + err = snd_emu10k1_pcm_efx(emu, 2); + if (err < 0) goto error; /* This stores the periods table. */ if (emu->card_capabilities->ca0151_chip) { /* P16V */ @@ -128,26 +132,33 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci, goto error; } - if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0) + err = snd_emu10k1_mixer(emu, 0, 3); + if (err < 0) goto error; - if ((err = snd_emu10k1_timer(emu, 0)) < 0) + err = snd_emu10k1_timer(emu, 0); + if (err < 0) goto error; - if ((err = snd_emu10k1_pcm_multi(emu, 3)) < 0) + err = snd_emu10k1_pcm_multi(emu, 3); + if (err < 0) goto error; if (emu->card_capabilities->ca0151_chip) { /* P16V */ - if ((err = snd_p16v_pcm(emu, 4)) < 0) + err = snd_p16v_pcm(emu, 4); + if (err < 0) goto error; } if (emu->audigy) { - if ((err = snd_emu10k1_audigy_midi(emu)) < 0) + err = snd_emu10k1_audigy_midi(emu); + if (err < 0) goto error; } else { - if ((err = snd_emu10k1_midi(emu)) < 0) + err = snd_emu10k1_midi(emu); + if (err < 0) goto error; } - if ((err = snd_emu10k1_fx8010_new(emu, 0)) < 0) + err = snd_emu10k1_fx8010_new(emu, 0); + if (err < 0) goto error; #ifdef ENABLE_SYNTH if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, @@ -174,7 +185,8 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci, "%s (rev.%d, serial:0x%x) at 0x%lx, irq %i", card->shortname, emu->revision, emu->serial, emu->port, emu->irq); - if ((err = snd_card_register(card)) < 0) + err = snd_card_register(card); + if (err < 0) goto error; if (emu->card_capabilities->emu_model) |