ALSA: hda: auto_parser: remove shadowed variable declaration
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 2 Sep 2020 21:21:25 +0000 (16:21 -0500)
committerTakashi Iwai <tiwai@suse.de>
Thu, 3 Sep 2020 07:27:00 +0000 (09:27 +0200)
Fix cppcheck warning:

sound/pci/hda/hda_auto_parser.c:353:7: style: Local variable 'i'
shadows outer variable [shadowVariable]
  int i = 0;
      ^
sound/pci/hda/hda_auto_parser.c:182:6: note: Shadowed declaration
 int i;
     ^
sound/pci/hda/hda_auto_parser.c:353:7: note: Shadow variable
  int i = 0;
      ^

It's not clear why a new declaration was added, remove and reuse
variable declared with larger scope.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_auto_parser.c

index 824f4ac1a8ce787d142ad42e17aab63b07b04c1e..4dc01647753c8fd4090949d048585293042ac428 100644 (file)
@@ -350,7 +350,7 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
         */
        if (!cfg->line_outs && cfg->hp_outs > 1 &&
            !(cond_flags & HDA_PINCFG_NO_HP_FIXUP)) {
-               int i = 0;
+               i = 0;
                while (i < cfg->hp_outs) {
                        /* The real HPs should have the sequence 0x0f */
                        if ((hp_out[i].seq & 0x0f) == 0x0f) {