Skip to contentSkip to conversation

sound: cmipci.c fix shadowed variable warning

PATCH Applied Harvey Harrison 2 participants 2 messages Feb 28, 2008 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/12 sound: cmipci.c fix shadowed variable warning

A temporary variable for each mixer element is used in an initialization loop, use the name elem_id.

sound/pci/cmipci.c:2747:26: warning: symbol 'id' shadows an earlier one sound/pci/cmipci.c:56:13: originally declared here

---
 sound/pci/cmipci.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
sound/pci/cmipci.c +5 -5
index 135f308..3e763b9 100644
@@ -2744,12 +2744,12 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
 	}
 
 	for (idx = 0; idx < CM_SAVED_MIXERS; idx++) {
-		struct snd_ctl_elem_id id;
+		struct snd_ctl_elem_id elem_id;
 		struct snd_kcontrol *ctl;
-		memset(&id, 0, sizeof(id));
-		id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-		strcpy(id.name, cm_saved_mixer[idx].name);
-		if ((ctl = snd_ctl_find_id(cm->card, &id)) != NULL)
+		memset(&elem_id, 0, sizeof(elem_id));
+		elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+		strcpy(elem_id.name, cm_saved_mixer[idx].name);
+		if ((ctl = snd_ctl_find_id(cm->card, &elem_id)) != NULL)
 			cm->mixer_res_ctl[idx] = ctl;
 	}
 
Signature · 1 line
1.5.4.3.342.g99e8
Applied
#1 lore raw

At Wed, 27 Feb 2008 16:56:04 -0800,

Quoted 8 lines · Harvey Harrison

A temporary variable for each mixer element is used in an initialization loop, use the name elem_id.

sound/pci/cmipci.c:2747:26: warning: symbol 'id' shadows an earlier one sound/pci/cmipci.c:56:13: originally declared here

Thanks, applied most patches (with coding style fixes if any) to ALSA tree.

Takashi