ASoC: sigmadsp: fix simple_return.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Mon, 24 Nov 2014 20:49:44 +0000 (04:49 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 25 Nov 2014 11:07:53 +0000 (11:07 +0000)
sound/soc/codecs/sigmadsp.c:656:1-4: WARNING: end returns can be simpified and declaration on line 636 can be dropped

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/sigmadsp.c

index 6abefd27b86c6be9b065b0afdd3f2ca5e35ffb6c..34fdc402c1cc292b87f51e83ca1434a313cebd76 100644 (file)
@@ -633,7 +633,6 @@ static int sigmadsp_alloc_control(struct sigmadsp *sigmadsp,
 {
        struct snd_kcontrol_new template;
        struct snd_kcontrol *kcontrol;
-       int ret;
 
        memset(&template, 0, sizeof(template));
        template.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
@@ -653,11 +652,7 @@ static int sigmadsp_alloc_control(struct sigmadsp *sigmadsp,
        kcontrol->private_free = sigmadsp_control_free;
        ctrl->kcontrol = kcontrol;
 
-       ret = snd_ctl_add(sigmadsp->component->card->snd_card, kcontrol);
-       if (ret)
-               return ret;
-
-       return 0;
+       return snd_ctl_add(sigmadsp->component->card->snd_card, kcontrol);
 }
 
 static void sigmadsp_activate_ctrl(struct sigmadsp *sigmadsp,