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 259/326] sound/soc/mediatek/mt2701/mt2701-hdmi.c:88:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Wed, 24 Jun 2026 22:24:47 +0800 [thread overview]
Message-ID: <202606242257.fqQb06ux-lkp@intel.com> (raw)
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
reply other threads:[~2026-06-24 14:25 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=202606242257.fqQb06ux-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