Re: [PATCH v3 4/4] ASoC: codecs: Add FourSemi FS2104/5S audio amplifier driver
From: kernel test robot
Date: Fri Jul 18 2025 - 18:41:20 EST
Hi Nick,
kernel test robot noticed the following build warnings:
[auto build test WARNING on ed73a24357531e1747a6e140c329015da6429629]
url: https://github.com/intel-lab-lkp/linux/commits/Nick/dt-bindings-vendor-prefixes-Add-Shanghai-FourSemi-Semiconductor-Co-Ltd/20250718-201609
base: ed73a24357531e1747a6e140c329015da6429629
patch link: https://lore.kernel.org/r/20250718121221.76957-5-nick.li%40foursemi.com
patch subject: [PATCH v3 4/4] ASoC: codecs: Add FourSemi FS2104/5S audio amplifier driver
config: i386-buildonly-randconfig-004-20250719 (https://download.01.org/0day-ci/archive/20250719/202507190618.Gu5xvSUt-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250719/202507190618.Gu5xvSUt-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507190618.Gu5xvSUt-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
>> sound/soc/codecs/fs210x.c:1086:2: warning: variable 'ret' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
1086 | default:
| ^~~~~~~
sound/soc/codecs/fs210x.c:1092:9: note: uninitialized use occurs here
1092 | return ret;
| ^~~
>> sound/soc/codecs/fs210x.c:1077:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1077 | if (!fs210x->clk_bclk)
| ^~~~~~~~~~~~~~~~~
sound/soc/codecs/fs210x.c:1092:9: note: uninitialized use occurs here
1092 | return ret;
| ^~~
sound/soc/codecs/fs210x.c:1077:3: note: remove the 'if' if its condition is always false
1077 | if (!fs210x->clk_bclk)
| ^~~~~~~~~~~~~~~~~~~~~~
1078 | break;
| ~~~~~
sound/soc/codecs/fs210x.c:1062:9: note: initialize the variable 'ret' to silence this warning
1062 | int ret;
| ^
| = 0
2 warnings generated.
vim +/ret +1086 sound/soc/codecs/fs210x.c
1056
1057 static int fs210x_playback_event(struct snd_soc_dapm_widget *w,
1058 struct snd_kcontrol *kc, int event)
1059 {
1060 struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
1061 struct fs210x_priv *fs210x = snd_soc_component_get_drvdata(cmpnt);
1062 int ret;
1063
1064 mutex_lock(&fs210x->lock);
1065
1066 if (fs210x->is_suspended) {
1067 mutex_unlock(&fs210x->lock);
1068 return 0;
1069 }
1070
1071 switch (event) {
1072 case SND_SOC_DAPM_PRE_PMU:
1073 /*
1074 * If there is no bclk for us to set the clock output,
1075 * we will enable the device(start_work) in dai trigger.
1076 */
> 1077 if (!fs210x->clk_bclk)
1078 break;
1079 fs210x_bclk_set(fs210x, true);
1080 ret = fs210x_dev_play(fs210x);
1081 break;
1082 case SND_SOC_DAPM_POST_PMD:
1083 ret = fs210x_dev_stop(fs210x);
1084 fs210x_bclk_set(fs210x, false);
1085 break;
> 1086 default:
1087 break;
1088 }
1089
1090 mutex_unlock(&fs210x->lock);
1091
1092 return ret;
1093 }
1094
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki