* [morimoto:sound-cleanup-2026-06-19 260/326] sound/soc/mediatek/mt6797/mt6797-mt6351.c:219:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2026-06-24 15:58 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-24 15:58 UTC (permalink / raw)
To: Kuninori Morimoto; +Cc: llvm, oe-kbuild-all
tree: https://github.com/morimoto/linux sound-cleanup-2026-06-19
head: 885feafb1fe92b67450ae8ac4996368e3a6dd242
commit: ea64c228b8dadefdf4c174a71a6e57820da75c6c [260/326] ASoC: mediatek: mt6797-mt6351: use snd_soc_card_register()
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20260624/202606242358.Yfb71Aj5-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project a9b492db3d50683e446cd1a5c9ffaf4e92cb77a7)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260624/202606242358.Yfb71Aj5-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606242358.Yfb71Aj5-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> sound/soc/mediatek/mt6797/mt6797-mt6351.c:219:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
219 | if (!card)
| ^~~~~
sound/soc/mediatek/mt6797/mt6797-mt6351.c:222:6: note: uninitialized use occurs here
222 | if (ret)
| ^~~
sound/soc/mediatek/mt6797/mt6797-mt6351.c:219:2: note: remove the 'if' if its condition is always true
219 | if (!card)
| ^~~~~~~~~~
220 | ret = -ENOMEM;
sound/soc/mediatek/mt6797/mt6797-mt6351.c:190:9: note: initialize the variable 'ret' to silence this warning
190 | int ret, i;
| ^
| = 0
1 warning generated.
vim +219 sound/soc/mediatek/mt6797/mt6797-mt6351.c
183
184 static int mt6797_mt6351_dev_probe(struct platform_device *pdev)
185 {
186 struct snd_soc_card *card;
187 struct snd_soc_card_driver *card_driver = &mt6797_mt6351_card_driver;
188 struct device_node *platform_node, *codec_node;
189 struct snd_soc_dai_link *dai_link;
190 int ret, i;
191
192 platform_node = of_parse_phandle(pdev->dev.of_node,
193 "mediatek,platform", 0);
194 if (!platform_node) {
195 dev_err(&pdev->dev, "Property 'platform' missing or invalid\n");
196 return -EINVAL;
197 }
198 for_each_card_driver_prelinks(card_driver, i, dai_link) {
199 if (dai_link->platforms->name)
200 continue;
201 dai_link->platforms->of_node = platform_node;
202 }
203
204 codec_node = of_parse_phandle(pdev->dev.of_node,
205 "mediatek,audio-codec", 0);
206 if (!codec_node) {
207 dev_err(&pdev->dev,
208 "Property 'audio-codec' missing or invalid\n");
209 ret = -EINVAL;
210 goto put_platform_node;
211 }
212 for_each_card_driver_prelinks(card_driver, i, dai_link) {
213 if (dai_link->codecs->name)
214 continue;
215 dai_link->codecs->of_node = codec_node;
216 }
217
218 card = devm_snd_soc_card_register(&pdev->dev, card_driver);
> 219 if (!card)
220 ret = -ENOMEM;
221
222 if (ret)
223 dev_err(&pdev->dev, "%s snd_soc_card_register() fail %d\n",
224 __func__, ret);
225
226 of_node_put(codec_node);
227 put_platform_node:
228 of_node_put(platform_node);
229 return ret;
230 }
231
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-24 15:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 15:58 [morimoto:sound-cleanup-2026-06-19 260/326] sound/soc/mediatek/mt6797/mt6797-mt6351.c:219:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox