From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, perex@perex.cz
Cc: alsa-devel@alsa-project.org, tiwai@suse.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: generic: Remove redundant assignment to dac and dacs[i]
Date: Mon, 10 May 2021 12:57:28 +0200 [thread overview]
Message-ID: <959dfc79-cac1-0bb6-e725-874e7f7af0cf@linux.intel.com> (raw)
In-Reply-To: <1620643295-130162-1-git-send-email-jiapeng.chong@linux.alibaba.com>
On 5/10/2021 12:41 PM, Jiapeng Chong wrote:
> Variable dac and dacs[i] is set to zero, but this value is never read as
> it is overwritten or not used later on, hence it is a redundant assignment
> and can be removed.
>
> Clean up the following clang-analyzer warning:
>
> sound/pci/hda/hda_generic.c:1436:4: warning: Value stored to 'dac' is
> never read [clang-analyzer-deadcode.DeadStores].
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> sound/pci/hda/hda_generic.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
> index b638fc2..cce1bf7 100644
> --- a/sound/pci/hda/hda_generic.c
> +++ b/sound/pci/hda/hda_generic.c
> @@ -1433,7 +1433,6 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
> path = snd_hda_add_new_path(codec, dac, pin, 0);
> }
> if (!path) {
> - dac = dacs[i] = 0;
> badness += bad->no_dac;
> } else {
> /* print_nid_path(codec, "output", path); */
>
Not entirely true... dacs is passed by pointer, so value assigned to it
can be used somewhere else.
prev parent reply other threads:[~2021-05-10 10:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 10:41 [PATCH] ALSA: hda: generic: Remove redundant assignment to dac and dacs[i] Jiapeng Chong
2021-05-10 10:57 ` Amadeusz Sławiński [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=959dfc79-cac1-0bb6-e725-874e7f7af0cf@linux.intel.com \
--to=amadeuszx.slawinski@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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).