]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ALSA: isa: Fix assignment in if condition
authorTakashi Iwai <tiwai@suse.de>
Tue, 8 Jun 2021 14:04:48 +0000 (16:04 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 9 Jun 2021 15:29:48 +0000 (17:29 +0200)
ISA ES1688 and WSS  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-15-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/es1688/es1688_lib.c
sound/isa/wss/wss_lib.c

index 1816e55c6edf968cb734b573cb30049715fa37ec..8554cb2263c1f9d696a25a9d0e701c175cf04008 100644 (file)
@@ -971,7 +971,8 @@ int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip)
        strcpy(card->mixername, snd_es1688_chip_id(chip));
 
        for (idx = 0; idx < ARRAY_SIZE(snd_es1688_controls); idx++) {
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_es1688_controls[idx], chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&snd_es1688_controls[idx], chip));
+               if (err < 0)
                        return err;
        }
        for (idx = 0; idx < ES1688_INIT_TABLE_SIZE; idx++) {
index ea5d3cdfe4e4031e92cdc1fee508dd1b2b6d0797..743e0f05e33511f7d11d249d259a7917fb8f3f2e 100644 (file)
@@ -1493,7 +1493,8 @@ static int snd_wss_playback_open(struct snd_pcm_substream *substream)
        snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max);
 
        if (chip->claim_dma) {
-               if ((err = chip->claim_dma(chip, chip->dma_private_data, chip->dma1)) < 0)
+               err = chip->claim_dma(chip, chip->dma_private_data, chip->dma1);
+               if (err < 0)
                        return err;
        }
 
@@ -1533,7 +1534,8 @@ static int snd_wss_capture_open(struct snd_pcm_substream *substream)
        snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max);
 
        if (chip->claim_dma) {
-               if ((err = chip->claim_dma(chip, chip->dma_private_data, chip->dma2)) < 0)
+               err = chip->claim_dma(chip, chip->dma_private_data, chip->dma2);
+               if (err < 0)
                        return err;
        }
 
@@ -1934,7 +1936,8 @@ int snd_wss_timer(struct snd_wss *chip, int device)
        tid.card = chip->card->number;
        tid.device = device;
        tid.subdevice = 0;
-       if ((err = snd_timer_new(chip->card, "CS4231", &tid, &timer)) < 0)
+       err = snd_timer_new(chip->card, "CS4231", &tid, &timer);
+       if (err < 0)
                return err;
        strcpy(timer->name, snd_wss_chip_id(chip));
        timer->private_data = chip;