ALSA: vx: Fix assignment in if condition
[sfrench/cifs-2.6.git] / sound / drivers / vx / vx_mixer.c
index 13099f8c84d619e90b9e1d8a025fea25bce1c8fd..53d78eb13c53bcbe9b79c93f20b955bd6c1a3c95 100644 (file)
@@ -910,7 +910,8 @@ int snd_vx_mixer_new(struct vx_core *chip)
                temp = vx_control_output_level;
                temp.index = i;
                temp.tlv.p = chip->hw->output_level_db_scale;
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+               if (err < 0)
                        return err;
        }
 
@@ -921,22 +922,26 @@ int snd_vx_mixer_new(struct vx_core *chip)
                temp.index = i;
                temp.name = "PCM Playback Volume";
                temp.private_value = val;
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+               if (err < 0)
                        return err;
                temp = vx_control_output_switch;
                temp.index = i;
                temp.private_value = val;
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+               if (err < 0)
                        return err;
                temp = vx_control_monitor_gain;
                temp.index = i;
                temp.private_value = val;
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+               if (err < 0)
                        return err;
                temp = vx_control_monitor_switch;
                temp.index = i;
                temp.private_value = val;
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+               if (err < 0)
                        return err;
        }
        for (i = 0; i < chip->hw->num_outs; i++) {
@@ -944,20 +949,25 @@ int snd_vx_mixer_new(struct vx_core *chip)
                temp.index = i;
                temp.name = "PCM Capture Volume";
                temp.private_value = (i * 2) | (1 << 8);
-               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+               if (err < 0)
                        return err;
        }
 
        /* Audio source */
-       if ((err = snd_ctl_add(card, snd_ctl_new1(&vx_control_audio_src, chip))) < 0)
+       err = snd_ctl_add(card, snd_ctl_new1(&vx_control_audio_src, chip));
+       if (err < 0)
                return err;
        /* clock mode */
-       if ((err = snd_ctl_add(card, snd_ctl_new1(&vx_control_clock_mode, chip))) < 0)
+       err = snd_ctl_add(card, snd_ctl_new1(&vx_control_clock_mode, chip));
+       if (err < 0)
                return err;
        /* IEC958 controls */
-       if ((err = snd_ctl_add(card, snd_ctl_new1(&vx_control_iec958_mask, chip))) < 0)
+       err = snd_ctl_add(card, snd_ctl_new1(&vx_control_iec958_mask, chip));
+       if (err < 0)
                return err;
-       if ((err = snd_ctl_add(card, snd_ctl_new1(&vx_control_iec958, chip))) < 0)
+       err = snd_ctl_add(card, snd_ctl_new1(&vx_control_iec958, chip));
+       if (err < 0)
                return err;
        /* VU, peak, saturation meters */
        for (c = 0; c < 2; c++) {
@@ -968,7 +978,8 @@ int snd_vx_mixer_new(struct vx_core *chip)
                                temp = vx_control_saturation;
                                temp.index = i;
                                temp.private_value = val;
-                               if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+                               err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+                               if (err < 0)
                                        return err;
                        }
                        sprintf(name, "%s VU Meter", dir[c]);
@@ -976,14 +987,16 @@ int snd_vx_mixer_new(struct vx_core *chip)
                        temp.index = i;
                        temp.name = name;
                        temp.private_value = val;
-                       if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+                       err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+                       if (err < 0)
                                return err;
                        sprintf(name, "%s Peak Meter", dir[c]);
                        temp = vx_control_peak_meter;
                        temp.index = i;
                        temp.name = name;
                        temp.private_value = val;
-                       if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
+                       err = snd_ctl_add(card, snd_ctl_new1(&temp, chip));
+                       if (err < 0)
                                return err;
                }
        }