Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Wed, 24 Jun 2026 23:58:27 +0800	[thread overview]
Message-ID: <202606242358.Yfb71Aj5-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-06-24 15:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202606242358.Yfb71Aj5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox