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] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7b36055-a710-4d57-b952-33431876e221@ieee.org>
Date: Thu, 29 Feb 2024 07:21:13 -0600
From: Alex Elder <elder@...e.org>
To: Colin Ian King <colin.i.king@...il.com>,
 Vaibhav Agarwal <vaibhav.sr@...il.com>, Mark Greer <mgreer@...malcreek.com>,
 Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 greybus-dev@...ts.linaro.org, linux-staging@...ts.linux.dev
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] staging: greybus: Remove redundant variable 'mask'

On 2/29/24 6:05 AM, Colin Ian King wrote:
> The variable mask is being assigned and bit-set but it is never
> being used apart from this. The variable is redundant and can
> be removed.
> 
> Cleans up clang scan build warning:
> drivers/staging/greybus/audio_topology.c:764:15: warning: variable 'mask'
> set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>

This is a reasonable change, but I don't know this code that
well and would like to hear from Vaibhav (if possible) or
someone else whether they think the mask value *should* have
been used in this spot.  It doesn't look like it to me, but
I'd like you to get a second opinion...

					-Alex

> ---
>   drivers/staging/greybus/audio_topology.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c
> index 08e6a807c132..5dc4721105d4 100644
> --- a/drivers/staging/greybus/audio_topology.c
> +++ b/drivers/staging/greybus/audio_topology.c
> @@ -761,7 +761,6 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol,
>   {
>   	int ret, wi, ctl_id;
>   	unsigned int val, mux, change;
> -	unsigned int mask;
>   	struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
>   	struct snd_soc_dapm_widget *widget = wlist->widgets[0];
>   	struct gb_audio_ctl_elem_value gbvalue;
> @@ -802,7 +801,6 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol,
>   
>   	mux = ucontrol->value.enumerated.item[0];
>   	val = mux << e->shift_l;
> -	mask = e->mask << e->shift_l;
>   
>   	if (le32_to_cpu(gbvalue.value.enumerated_item[0]) !=
>   	    ucontrol->value.enumerated.item[0]) {
> @@ -815,7 +813,6 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol,
>   		if (ucontrol->value.enumerated.item[1] > e->items - 1)
>   			return -EINVAL;
>   		val |= ucontrol->value.enumerated.item[1] << e->shift_r;
> -		mask |= e->mask << e->shift_r;
>   		if (le32_to_cpu(gbvalue.value.enumerated_item[1]) !=
>   		    ucontrol->value.enumerated.item[1]) {
>   			change = 1;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ