Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [morimoto:sound-cleanup-2026-06-19 259/326] sound/soc/mediatek/mt2701/mt2701-hdmi.c:88:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2026-06-24 14:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-24 14:24 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: 406e3cf2881a82be44aa8ddb60795faf672bd453 [259/326] ASoC: mediatek: mt2701-hdmi: use snd_soc_card_register()
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20260624/202606242257.fqQb06ux-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/202606242257.fqQb06ux-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/202606242257.fqQb06ux-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> sound/soc/mediatek/mt2701/mt2701-hdmi.c:88:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      88 |         if (!card)
         |             ^~~~~
   sound/soc/mediatek/mt2701/mt2701-hdmi.c:93:9: note: uninitialized use occurs here
      93 |         return ret;
         |                ^~~
   sound/soc/mediatek/mt2701/mt2701-hdmi.c:88:2: note: remove the 'if' if its condition is always true
      88 |         if (!card)
         |         ^~~~~~~~~~
      89 |                 ret = -ENOMEM;
   sound/soc/mediatek/mt2701/mt2701-hdmi.c:65:9: note: initialize the variable 'ret' to silence this warning
      65 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +88 sound/soc/mediatek/mt2701/mt2701-hdmi.c

    56	
    57	static int mt2701_hdmi_machine_probe(struct platform_device *pdev)
    58	{
    59		struct snd_soc_card *card;
    60		struct snd_soc_card_driver *card_driver = &mt2701_hdmi_card_driver;
    61		struct device *dev = &pdev->dev;
    62		struct device_node *platform_node;
    63		struct device_node *codec_node;
    64		struct snd_soc_dai_link *dai_link;
    65		int ret;
    66		int i;
    67	
    68		platform_node = of_parse_phandle(dev->of_node, "mediatek,platform", 0);
    69		if (!platform_node)
    70			return dev_err_probe(dev, -EINVAL,
    71					     "Property 'mediatek,platform' missing\n");
    72	
    73		for_each_card_driver_prelinks(card_driver, i, dai_link) {
    74			if (dai_link->platforms->name)
    75				continue;
    76			dai_link->platforms->of_node = platform_node;
    77		}
    78	
    79		codec_node = of_parse_phandle(dev->of_node, "mediatek,audio-codec", 0);
    80		if (!codec_node) {
    81			of_node_put(platform_node);
    82			return dev_err_probe(dev, -EINVAL,
    83					     "Property 'mediatek,audio-codec' missing\n");
    84		}
    85		mt2701_hdmi_dai_links[DAI_LINK_BE_HDMI_I2S].codecs->of_node = codec_node;
    86	
    87		card = devm_snd_soc_card_register(dev, card_driver);
  > 88		if (!card)
    89			ret = -ENOMEM;
    90	
    91		of_node_put(platform_node);
    92		of_node_put(codec_node);
    93		return ret;
    94	}
    95	

--
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 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 14:24 [morimoto:sound-cleanup-2026-06-19 259/326] sound/soc/mediatek/mt2701/mt2701-hdmi.c:88: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