Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [morimoto:sound-cleanup-2026-06-16 326/326] sound/soc/samsung/arndale.c:176:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2026-06-17  8:32 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-17  8:32 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/morimoto/linux sound-cleanup-2026-06-16
head:   5ce50ac7d0a59c6fb15e1baa7e6824ac096fe092
commit: c4ef8b77bf42812df873dc078097d5e8f196351e [326/326] ASoC: samsung: arndale: use snd_soc_card_register()
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20260617/202606171609.mXRZth2s-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project e19d1f51a2c80b63cd8ca95bcc757b7077112808)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260617/202606171609.mXRZth2s-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/202606171609.mXRZth2s-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/soc/samsung/arndale.c:176:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     176 |         if (!card)
         |             ^~~~~
   sound/soc/samsung/arndale.c:179:6: note: uninitialized use occurs here
     179 |         if (ret) {
         |             ^~~
   sound/soc/samsung/arndale.c:176:2: note: remove the 'if' if its condition is always true
     176 |         if (!card)
         |         ^~~~~~~~~~
     177 |                 ret = -ENOMEM;
   sound/soc/samsung/arndale.c:152:9: note: initialize the variable 'ret' to silence this warning
     152 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +176 sound/soc/samsung/arndale.c

   145	
   146	static int arndale_audio_probe(struct platform_device *pdev)
   147	{
   148		struct device_node *np = pdev->dev.of_node;
   149		struct snd_soc_card *card;
   150		struct snd_soc_card_driver *card_driver;
   151		struct snd_soc_dai_link *dai_link;
   152		int ret;
   153	
   154		card_driver = (struct snd_soc_card_driver *)of_device_get_match_data(&pdev->dev);
   155		dai_link = card_driver->dai_link;
   156	
   157		dai_link->cpus->of_node = of_parse_phandle(np, "samsung,audio-cpu", 0);
   158		if (!dai_link->cpus->of_node) {
   159			dev_err(&pdev->dev,
   160				"Property 'samsung,audio-cpu' missing or invalid\n");
   161			return -EINVAL;
   162		}
   163	
   164		if (!dai_link->platforms->name)
   165			dai_link->platforms->of_node = dai_link->cpus->of_node;
   166	
   167		dai_link->codecs->of_node = of_parse_phandle(np, "samsung,audio-codec", 0);
   168		if (!dai_link->codecs->of_node) {
   169			dev_err(&pdev->dev,
   170				"Property 'samsung,audio-codec' missing or invalid\n");
   171			ret = -EINVAL;
   172			goto err_put_of_nodes;
   173		}
   174	
   175		card = devm_snd_soc_card_register(&pdev->dev, card_driver);
 > 176		if (!card)
   177			ret = -ENOMEM;
   178	
   179		if (ret) {
   180			dev_err_probe(&pdev->dev, ret,
   181				      "snd_soc_card_register() failed\n");
   182			goto err_put_of_nodes;
   183		}
   184		return 0;
   185	
   186	err_put_of_nodes:
   187		arndale_put_of_nodes(card_driver);
   188		return ret;
   189	}
   190	

--
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-17  8:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17  8:32 [morimoto:sound-cleanup-2026-06-16 326/326] sound/soc/samsung/arndale.c:176: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