[alsa-devel] [PATCH] ASoC: Intel: Skylake: Fix compiler warning -Wmaybe-uninitialized

Takashi Sakamoto o-takashi at sakamocchi.jp
Mon Feb 19 07:35:23 CET 2018


Hi,

On Feb 19 2018 15:02, Kirill Marinushkin wrote:
> Configuration:
> 
> SND_SOC_INTEL_SKYLAKE=y
> PM_SLEEP=y
> 
> Warning message:
> 
> sound/soc/intel/skylake/skl.c: In function 'skl_resume':
> sound/soc/intel/skylake/skl.c:326:6: warning: 'ret' may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>    int ret;
>        ^~~
> 
> Fixes: 4557c305d4fc ("ASoC: Intel: Skylake: Add support for active suspend")
> Signed-off-by: Kirill Marinushkin <k.marinushkin at gmail.com>
> Cc: Liam Girdwood <lgirdwood at gmail.com>
> Cc: Mark Brown <broonie at kernel.org>
> Cc: Jaroslav Kysela <perex at perex.cz>
> Cc: Takashi Iwai <tiwai at suse.com>
> Cc: Vinod Koul <vinod.koul at intel.com>
> Cc: Guneshwor Singh <guneshwor.o.singh at intel.com>
> Cc: Naveen Manohar <naveen.m at intel.com>
> Cc: Harsha Priya N <harshapriya.n at intel.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> Cc: alsa-devel at alsa-project.org
> Cc: linux-kernel at vger.kernel.org
> ---
>   sound/soc/intel/skylake/skl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
> index 31d8634e8aa1..273a9ab75489 100644
> --- a/sound/soc/intel/skylake/skl.c
> +++ b/sound/soc/intel/skylake/skl.c
> @@ -323,7 +323,7 @@ static int skl_resume(struct device *dev)
>   	struct skl *skl  = ebus_to_skl(ebus);
>   	struct hdac_bus *bus = ebus_to_hbus(ebus);
>   	struct hdac_ext_link *hlink = NULL;
> -	int ret;
> +	int ret = 0;
>   
>   	/* Turned OFF in HDMI codec driver after codec reconfiguration */
>   	if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {

At current HEAD (ea954fbc35e6) in 'topic/intel' branch[1] of Mark's 
tree, this issue was already fixed by Arnd Bergmann Nov 2017 by his 
commit cc20c4df1627 ('ASoC: intel: initialize return value properly')[2].


[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/log/?h=topic/intel
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?h=topic/intel&id=cc20c4df1627

Regards

Takashi Sakamoto


More information about the Alsa-devel mailing list