From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: kernel test robot <lkp@intel.com>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: Re: sound/soc/generic/simple-card.c:259:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
Date: 24 Aug 2021 13:43:38 +0900 [thread overview]
Message-ID: <87eeajmozp.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <202108241108.EJSE2QL8-lkp@intel.com>
Hi
> >> sound/soc/generic/simple-card.c:259:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
> struct device *dev = simple_priv_to_dev(priv);
> ^~~
> sound/soc/generic/simple-card.c:259:17: note: Value stored to 'dev' during its initialization is never read
> struct device *dev = simple_priv_to_dev(priv);
> ^~~
(snip)
> e59289cda8dec0 Kuninori Morimoto 2019-03-20 253 static int simple_dai_link_of(struct asoc_simple_priv *priv,
> d947cdfd4be29c Kuninori Morimoto 2018-12-20 254 struct device_node *np,
> d947cdfd4be29c Kuninori Morimoto 2018-12-20 255 struct device_node *codec,
> 17029e494edc68 Kuninori Morimoto 2018-12-20 256 struct link_info *li,
> d947cdfd4be29c Kuninori Morimoto 2018-12-20 257 bool is_top)
> 6a91a17bd7b92b Jean-Francois Moine 2014-03-20 258 {
> f531913f01a072 Kuninori Morimoto 2014-09-09 @259 struct device *dev = simple_priv_to_dev(priv);
> 17029e494edc68 Kuninori Morimoto 2018-12-20 260 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
> 5bb5ac71e3f4f8 Kuninori Morimoto 2021-04-14 261 struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
> 5bb5ac71e3f4f8 Kuninori Morimoto 2021-04-14 262 struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
> 5bb5ac71e3f4f8 Kuninori Morimoto 2021-04-14 263 struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
> 1b5721b24306c2 Kuninori Morimoto 2014-10-27 264 struct device_node *cpu = NULL;
> d947cdfd4be29c Kuninori Morimoto 2018-12-20 265 struct device_node *node = NULL;
> e0ae225b7e96e5 Jun Nie 2015-04-29 266 struct device_node *plat = NULL;
> 6ad76b573bb63e Kuninori Morimoto 2021-05-11 267 char dai_name[64];
> b3ca11ff59bc58 Jyri Sarha 2014-03-24 268 char prop[128];
> b3ca11ff59bc58 Jyri Sarha 2014-03-24 269 char *prefix = "";
> 25c4a9b614f101 Mark Brown 2021-04-23 270 int ret, single_cpu = 0;
> 6a91a17bd7b92b Jean-Francois Moine 2014-03-20 271
> d947cdfd4be29c Kuninori Morimoto 2018-12-20 272 cpu = np;
> d947cdfd4be29c Kuninori Morimoto 2018-12-20 273 node = of_get_parent(np);
> 17029e494edc68 Kuninori Morimoto 2018-12-20 274
> 17029e494edc68 Kuninori Morimoto 2018-12-20 275 dev_dbg(dev, "link_of (%pOF)\n", node);
Ahh...,
"dev" at 259 is used only at 275 dev_dbg(dev, ...), and this
warning is for non DEBUG case.
I don't like below, but is this the only solution ?
+#ifdef DEBUG
struct device *dev = simple_priv_to_dev(priv);
+#endif
Maybe samething happen at audio-graph-card.c :: graph_dai_link_of(), too.
Thank you for your help !!
Best regards
---
Kuninori Morimoto
prev parent reply other threads:[~2021-08-24 4:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 3:34 sound/soc/generic/simple-card.c:259:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
2021-08-24 4:43 ` Kuninori Morimoto [this message]
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=87eeajmozp.wl-kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=broonie@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).