lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <s5hy3dqmdox.wl-tiwai@suse.de>
Date:   Wed, 01 Aug 2018 15:14:22 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     "Walter Harms" <wharms@....de>
Cc:     <alsa-devel@...a-project.org>,
        "Jaya Kumar" <jayakumar.alsa@...il.com>,
        "Jaroslav Kysela" <perex@...ex.cz>,
        <kernel-janitors@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/9] ALSA: emu10k1: remove redundant variable attn

On Wed, 01 Aug 2018 15:03:45 +0200,
Walter Harms wrote:
> 
> From: Colin Ian King <colin.king@...onical.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@...onical.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)

What does it have to do with this patch...?

The code there is OK, although it could be a bit optimized with a
static array for the fixed routing.  But it's pretty minor and it's no
hot path, so no need to bother complicating things.


thanks,

Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ