All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [RFC PATCH 03/23] ALSA: pci/asihpi: remove 'set but not used' warnings
Date: Thu,  2 Jul 2020 14:35:44 -0500	[thread overview]
Message-ID: <20200702193604.169059-4-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200702193604.169059-1-pierre-louis.bossart@linux.intel.com>

Fix W=1 warnings by removing 2 unnecessary initializations and
removing a variable that's not used.

sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_tuner_band_get’:
sound/pci/asihpi/asihpi.c:1907:6: warning: variable ‘num_bands’ set
but not used [-Wunused-but-set-variable]
 1907 |  u32 num_bands = 0;
      |      ^~~~~~~~~
sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_tuner_band_put’:
sound/pci/asihpi/asihpi.c:1934:6: warning: variable ‘num_bands’ set
 but not used [-Wunused-but-set-variable]
 1934 |  u32 num_bands = 0;
      |      ^~~~~~~~~
sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_mux_info’:
sound/pci/asihpi/asihpi.c:2164:6: warning: variable ‘err’ set but not
 used [-Wunused-but-set-variable]
 2164 |  int err;
      |      ^~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/pci/asihpi/asihpi.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index a9540c2c4a1a..faa879f175a9 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -1904,7 +1904,7 @@ static int snd_asihpi_tuner_band_get(struct snd_kcontrol *kcontrol,
 	*/
 	u16 band, idx;
 	u16 tuner_bands[HPI_TUNER_BAND_LAST];
-	u32 num_bands = 0;
+	u32 num_bands;
 
 	num_bands = asihpi_tuner_band_query(kcontrol, tuner_bands,
 				HPI_TUNER_BAND_LAST);
@@ -1931,7 +1931,7 @@ static int snd_asihpi_tuner_band_put(struct snd_kcontrol *kcontrol,
 	unsigned int idx;
 	u16 band;
 	u16 tuner_bands[HPI_TUNER_BAND_LAST];
-	u32 num_bands = 0;
+	u32 num_bands;
 
 	num_bands = asihpi_tuner_band_query(kcontrol, tuner_bands,
 			HPI_TUNER_BAND_LAST);
@@ -2161,7 +2161,6 @@ static int snd_card_asihpi_mux_count_sources(struct snd_kcontrol *snd_control)
 static int snd_asihpi_mux_info(struct snd_kcontrol *kcontrol,
 			       struct snd_ctl_elem_info *uinfo)
 {
-	int err;
 	u16 src_node_type, src_node_index;
 	u32 h_control = kcontrol->private_value;
 
@@ -2174,10 +2173,9 @@ static int snd_asihpi_mux_info(struct snd_kcontrol *kcontrol,
 		uinfo->value.enumerated.item =
 		    uinfo->value.enumerated.items - 1;
 
-	err =
-	    hpi_multiplexer_query_source(h_control,
-					uinfo->value.enumerated.item,
-					&src_node_type, &src_node_index);
+	hpi_multiplexer_query_source(h_control,
+				     uinfo->value.enumerated.item,
+				     &src_node_type, &src_node_index);
 
 	sprintf(uinfo->value.enumerated.name, "%s %d",
 		asihpi_src_names[src_node_type - HPI_SOURCENODE_NONE],
-- 
2.25.1


  parent reply	other threads:[~2020-07-02 19:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 19:35 [RFC PATCH 00/23] ALSA: fix kernel-doc and W=1 warnings Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 01/23] ALSA: isa/gus: remove -Wmissing-prototypes warnings Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 02/23] ALSA: isa/gus: remove 'set but not used' warning Pierre-Louis Bossart
2020-07-02 19:35 ` Pierre-Louis Bossart [this message]
2020-07-02 19:35 ` [RFC PATCH 04/23] ALSA: pci/asihpi: fix kernel-doc Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 05/23] ALSA: pci/asihpi: remove 'set but not used' warning Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 06/23] ALSA: pci/echoaudio: " Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 07/23] ALSA: pci/aw2-saa7146: " Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 08/23] ALSA: pci/ctxfi/ctatc: fix kernel-doc Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 09/23] ALSA: pci/ctxfi: fix kernel-doc warnings Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 10/23] ALSA: usb/line6: remove 'defined but not used' warning Pierre-Louis Bossart
2020-07-07 10:08   ` Takashi Iwai
2020-07-07 15:49     ` Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 11/23] ASoC: pci/emu10k1: remove "set but not used' warnings Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 12/23] ALSA: firewire: fix kernel-doc Pierre-Louis Bossart
2020-07-03  0:56   ` Takashi Sakamoto
2020-07-02 19:35 ` [RFC PATCH 13/23] ALSA: pci/emu10k1: remove 'set but not used' warning Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 14/23] ALSA: pci/korg1212: remove 'set but not used' warnings Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 15/23] ALSA: pci/rme9652/hdspm: remove always true condition Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 16/23] ALSA: pci/oxygen/xonar_wm87x6: " Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 17/23] ALSA: xen: remove 'set but not used' warning Pierre-Louis Bossart
2020-07-02 19:35 ` [RFC PATCH 18/23] ALSA: pci/es1938: " Pierre-Louis Bossart
2020-07-02 19:36 ` [RFC PATCH 19/23] ALSA: pci/fm801: fix kernel-doc Pierre-Louis Bossart
2020-07-02 19:36 ` [RFC PATCH 20/23] ALSA: pci/via82xx: remove 'set but not used' warnings Pierre-Louis Bossart
2020-07-02 19:36 ` [RFC PATCH 21/23] ALSA: pcmcia/pdaudiocf: fix kernel-doc Pierre-Louis Bossart
2020-07-02 19:36 ` [RFC PATCH 22/23] ALSA: vx_core: remove warning for empty loop body Pierre-Louis Bossart
2020-07-02 19:36 ` [RFC PATCH 23/23] ALSA: pci/au88x0: remove "defined but not used" warnings Pierre-Louis Bossart
2020-07-07 10:21 ` [RFC PATCH 00/23] ALSA: fix kernel-doc and W=1 warnings Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200702193604.169059-4-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.