diff mbox series

[10/18] ALSA: hda: auto_parser: remove shadowed variable declaration

Message ID 20200902212133.30964-11-pierre-louis.bossart@linux.intel.com
State Accepted
Commit e9bd25885c7f799134534989b9f13c3db5ce6a16
Headers show
Series ALSA: cleanups for sparse/cppcheck warnings | expand

Commit Message

Pierre-Louis Bossart Sept. 2, 2020, 9:21 p.m. UTC
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>
---
 sound/pci/hda/hda_auto_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 824f4ac1a8ce..4dc01647753c 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -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) {