ASoC: Intel: cht: fix uninit variable warning
authorVinod Koul <vinod.koul@intel.com>
Fri, 8 Jul 2016 13:00:17 +0000 (18:30 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 8 Jul 2016 14:36:45 +0000 (16:36 +0200)
Kbuild bot reports that we might use dai_index uninitialized.

sound/soc/intel/boards/cht_bsw_rt5645.c:391:37: warning: 'dai_index' may be used uninitialized in this function [-Wmaybe-uninitialized]

Since it is theoretically possible, set it while initializing.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/cht_bsw_rt5645.c

index f26c7b8545ae1d4b85c9400319487ccfc60937e7..56056ed7fcfd1e90b48f96316e1750fd92e113df 100644 (file)
@@ -357,7 +357,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
        char codec_name[16];
        struct sst_acpi_mach *mach;
        const char *i2c_name = NULL;
-       int dai_index;
+       int dai_index = 0;
 
        drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC);
        if (!drv)