LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/3] sound: patch_sigmatel.c fix shadowed variable warning
@ 2008-02-29  0:18 Harvey Harrison
  2008-02-29 11:06 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Harvey Harrison @ 2008-02-29  0:18 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: LKML

Temp variable in the loop shadows the second argument (which is otherwise
unused in this function).  Change this to defcfg as it is used to hold
the default config.
sound/pci/hda/patch_sigmatel.c:2759:18: warning: symbol 'cfg' shadows an earlier one
sound/pci/hda/patch_sigmatel.c:2734:26: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 sound/pci/hda/patch_sigmatel.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 2912047..6a7f508 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2757,11 +2757,11 @@ static int stac9200_auto_create_lfe_ctls(struct hda_codec *codec,
 	if (lfe_pin == 0 && spec->autocfg.speaker_outs == 0) {
 		for (i = 0; i < spec->autocfg.line_outs && lfe_pin == 0x0; i++) {
 			hda_nid_t pin = spec->autocfg.line_out_pins[i];
-			unsigned long cfg;
-			cfg = snd_hda_codec_read(codec, pin, 0,
+			unsigned long defcfg;
+			defcfg = snd_hda_codec_read(codec, pin, 0,
 						 AC_VERB_GET_CONFIG_DEFAULT,
 						 0x00);
-			if (get_defcfg_device(cfg) == AC_JACK_SPEAKER) {
+			if (get_defcfg_device(defcfg) == AC_JACK_SPEAKER) {
 				unsigned long wcaps = get_wcaps(codec, pin);
 				wcaps &= (AC_WCAP_STEREO | AC_WCAP_OUT_AMP);
 				if (wcaps == AC_WCAP_OUT_AMP)
-- 
1.5.4.3.342.g99e8



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] sound: patch_sigmatel.c fix shadowed variable warning
  2008-02-29  0:18 [PATCH 2/3] sound: patch_sigmatel.c fix shadowed variable warning Harvey Harrison
@ 2008-02-29 11:06 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2008-02-29 11:06 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: LKML

At Thu, 28 Feb 2008 16:18:10 -0800,
Harvey Harrison wrote:
> 
> Temp variable in the loop shadows the second argument (which is otherwise
> unused in this function).  Change this to defcfg as it is used to hold
> the default config.
> sound/pci/hda/patch_sigmatel.c:2759:18: warning: symbol 'cfg' shadows an earlier one
> sound/pci/hda/patch_sigmatel.c:2734:26: originally declared here
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

Thanks, applied to ALSA tree.
(Oh it's using long instead of int - although it's harmless, I'll fix
 soon...)


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-29 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-29  0:18 [PATCH 2/3] sound: patch_sigmatel.c fix shadowed variable warning Harvey Harrison
2008-02-29 11:06 ` Takashi Iwai

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).