All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] ALSA: remove redundant variables
@ 2018-08-01 10:47 ` Colin King
  0 siblings, 0 replies; 84+ messages in thread
From: Colin King @ 2018-08-01 10:47 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Liam Girdwood,
	Mark Brown, Olivier Moysan, Arnaud Pouliquen, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Clean up code by removing redundant variables that were
detected by clang

Colin Ian King (9):
  ALSA: asihpi: remove redundant variable max_streams
  ALSA: cs5535audio: remove redundant pointer 'dma'
  ALSA: emu10k1: remove redundant variable attn
  ALSA: ens137x: remove redundant array pcm_devs
  ALSA: sonicvibes: remove redundant pointer 'dir'
  ASoC: nau8540: remove redundant variable osrate
  ASoC: stm32: remove redundant pointers 'priv' and 'rtd'
  ALSA: usb-audio: remove redundant pointer 'urb'
  ALSA: intel_hdmi: remove redundant variable cfg_val

 sound/pci/asihpi/hpi6205.c          | 5 -----
 sound/pci/cs5535audio/cs5535audio.c | 7 +------
 sound/pci/emu10k1/emupcm.c          | 3 +--
 sound/pci/ens1370.c                 | 3 +--
 sound/pci/sonicvibes.c              | 2 --
 sound/soc/codecs/nau8540.c          | 3 ---
 sound/soc/stm/stm32_adfsdm.c        | 8 +-------
 sound/usb/endpoint.c                | 2 --
 sound/x86/intel_hdmi_audio.c        | 2 --
 9 files changed, 4 insertions(+), 31 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 84+ messages in thread
* re: [PATCH 3/9] ALSA: emu10k1: remove redundant variable attn
  2018-08-01 10:47   ` Colin King
  (?)
@ 2018-08-01 13:03 ` Walter Harms
  -1 siblings, 0 replies; 84+ messages in thread
From: Walter Harms @ 2018-08-01 13:03 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable attn is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'attn' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/pci/emu10k1/emupcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index 69f9b100bd24..26f6eda3e766 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -290,7 +290,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1
*emu,
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	unsigned int silent_page, tmp;
 	int voice, stereo, w_16;
-	unsigned char attn, send_amount[8];
+	unsigned char send_amount[8];
 	unsigned char send_routing[8];
 	unsigned long flags;
 	unsigned int pitch_target;
@@ -313,7 +313,6 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1
*emu,
  	/* volume parameters */
 	if (extra) {
-		attn = 0;
 		memset(send_routing, 0, sizeof(send_routing));
 		send_routing[0] = 0;
 		send_routing[1] = 1;


IMHO, this code is a bit fishy.
The memset() sould go in the init section
and in the else branch tmp is set, maybe its an idea
to set it here also (for symmetry)
just my 2 cents,

re,
 wh



-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-08-06 20:01 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 10:47 [PATCH 0/9] ALSA: remove redundant variables Colin King
2018-08-01 10:47 ` Colin King
2018-08-01 10:47 ` Colin King
2018-08-01 10:47 ` [PATCH 1/9] ALSA: asihpi: remove redundant variable max_streams Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 12:00   ` Takashi Iwai
2018-08-01 12:00     ` Takashi Iwai
2018-08-01 12:00     ` Takashi Iwai
2018-08-01 12:00     ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 2/9] ALSA: cs5535audio: remove redundant pointer 'dma' Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 3/9] ALSA: emu10k1: remove redundant variable attn Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 4/9] ALSA: ens137x: remove redundant array pcm_devs Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 5/9] ALSA: sonicvibes: remove redundant pointer 'dir' Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 6/9] ASoC: nau8540: remove redundant variable osrate Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 11:17   ` Applied "ASoC: nau8540: remove redundant variable osrate" to the asoc tree Mark Brown
2018-08-01 11:17     ` Mark Brown
2018-08-01 11:17     ` Mark Brown
2018-08-01 11:17     ` Mark Brown
2018-08-01 10:47 ` [PATCH 7/9] ASoC: stm32: remove redundant pointers 'priv' and 'rtd' Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 11:16   ` Applied "ASoC: stm32: remove redundant pointers 'priv' and 'rtd'" to the asoc tree Mark Brown
2018-08-01 11:16     ` Mark Brown
2018-08-01 11:16     ` Mark Brown
2018-08-01 11:16     ` Mark Brown
2018-08-01 10:47 ` [PATCH 8/9] ALSA: usb-audio: remove redundant pointer 'urb' Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 12:01   ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 12:01     ` Takashi Iwai
2018-08-01 10:47 ` [PATCH 9/9] ALSA: intel_hdmi: remove redundant variable cfg_val Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 10:47   ` Colin King
2018-08-01 11:00   ` Takashi Iwai
2018-08-01 11:00     ` Takashi Iwai
2018-08-01 11:00     ` Takashi Iwai
2018-08-01 11:00     ` Takashi Iwai
2018-08-01 14:55     ` [alsa-devel] " Pierre-Louis Bossart
2018-08-01 14:55       ` Pierre-Louis Bossart
2018-08-01 14:55       ` Pierre-Louis Bossart
2018-08-06 18:37     ` Pierre-Louis Bossart
2018-08-06 18:37       ` Pierre-Louis Bossart
2018-08-06 18:37       ` Pierre-Louis Bossart
2018-08-06 19:37       ` Takashi Iwai
2018-08-06 19:37         ` Takashi Iwai
2018-08-06 19:37         ` Takashi Iwai
2018-08-06 19:59         ` Pierre-Louis Bossart
2018-08-06 19:59           ` Pierre-Louis Bossart
2018-08-06 19:59           ` Pierre-Louis Bossart
2018-08-01 13:03 [PATCH 3/9] ALSA: emu10k1: remove redundant variable attn Walter Harms
2018-08-01 13:03 ` Walter Harms
2018-08-01 13:03 ` Walter Harms
2018-08-01 13:14 ` Takashi Iwai
2018-08-01 13:14   ` Takashi Iwai
2018-08-01 13:14   ` Takashi Iwai

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.