ALSA: hda: generic: Remove redundant assignment to dac
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Thu, 13 May 2021 11:11:11 +0000 (19:11 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 14 May 2021 07:48:33 +0000 (09:48 +0200)
Variable dac 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>
Link: https://lore.kernel.org/r/1620904271-76027-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_generic.c

index b638fc2ef6f72173ccf60eaa06f52c631d6f9ea9..fc0295790f6387d2658cac762bfa2868e4c17d45 100644 (file)
@@ -1433,7 +1433,7 @@ 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;
+                       dacs[i] = 0;
                        badness += bad->no_dac;
                } else {
                        /* print_nid_path(codec, "output", path); */