Browse Source

ASoC: Intel: cht: fix uninit variable warning

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>
Vinod Koul 9 years ago
parent
commit
5d554ea4f2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      sound/soc/intel/boards/cht_bsw_rt5645.c

+ 1 - 1
sound/soc/intel/boards/cht_bsw_rt5645.c

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