ALSA: sparc: Fix assignment in if condition
authorTakashi Iwai <tiwai@suse.de>
Tue, 8 Jun 2021 14:05:32 +0000 (16:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 9 Jun 2021 15:30:29 +0000 (17:30 +0200)
SPARC 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-59-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/sparc/amd7930.c
sound/sparc/cs4231.c
sound/sparc/dbri.c

index d24ae00878f5a75d5923d782254b367922af2e47..c434b69a83f142977cb168ee19552a7b3cd882a9 100644 (file)
@@ -975,8 +975,9 @@ static int snd_amd7930_create(struct snd_card *card,
 
        spin_unlock_irqrestore(&amd->lock, flags);
 
-       if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
-                                 amd, &snd_amd7930_dev_ops)) < 0) {
+       err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
+                            amd, &snd_amd7930_dev_ops);
+       if (err < 0) {
                snd_amd7930_free(amd);
                return err;
        }
@@ -1019,13 +1020,16 @@ static int amd7930_sbus_probe(struct platform_device *op)
                                      irq, dev_num, &amd)) < 0)
                goto out_err;
 
-       if ((err = snd_amd7930_pcm(amd)) < 0)
+       err = snd_amd7930_pcm(amd);
+       if (err < 0)
                goto out_err;
 
-       if ((err = snd_amd7930_mixer(amd)) < 0)
+       err = snd_amd7930_mixer(amd);
+       if (err < 0)
                goto out_err;
 
-       if ((err = snd_card_register(card)) < 0)
+       err = snd_card_register(card);
+       if (err < 0)
                goto out_err;
 
        amd->next = amd7930_list;
index 35c17803a43098da1769b5fa6d5ef24a7de09b35..2942c8c7a2366fa4474fe7b6e3a36b6fd137fe5d 100644 (file)
@@ -1828,8 +1828,9 @@ static int snd_cs4231_sbus_create(struct snd_card *card,
        }
        snd_cs4231_init(chip);
 
-       if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
-                                 chip, &snd_cs4231_sbus_dev_ops)) < 0) {
+       err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
+                            chip, &snd_cs4231_sbus_dev_ops);
+       if (err < 0) {
                snd_cs4231_sbus_free(chip);
                return err;
        }
@@ -2020,8 +2021,9 @@ static int snd_cs4231_ebus_create(struct snd_card *card,
        }
        snd_cs4231_init(chip);
 
-       if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
-                                 chip, &snd_cs4231_ebus_dev_ops)) < 0) {
+       err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
+                            chip, &snd_cs4231_ebus_dev_ops);
+       if (err < 0) {
                snd_cs4231_ebus_free(chip);
                return err;
        }
index b055f583957877d462daaee0cb1a0888db752277..6b84f66e4af4e843f3f21819dca9c7c7938d7821 100644 (file)
@@ -2226,11 +2226,12 @@ static int snd_dbri_pcm(struct snd_card *card)
        struct snd_pcm *pcm;
        int err;
 
-       if ((err = snd_pcm_new(card,
-                              /* ID */             "sun_dbri",
-                              /* device */         0,
-                              /* playback count */ 1,
-                              /* capture count */  1, &pcm)) < 0)
+       err = snd_pcm_new(card,
+                         /* ID */          "sun_dbri",
+                         /* device */      0,
+                         /* playback count */ 1,
+                         /* capture count */  1, &pcm);
+       if (err < 0)
                return err;
 
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops);