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: <2026012002-postal-fancy-8329@gregkh>
Date: Tue, 20 Jan 2026 08:09:53 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Lee Yongjun <jun85566@...il.com>
Cc: vaibhav.sr@...il.com, mgreer@...malcreek.com, johan@...nel.org,
	elder@...nel.org, greybus-dev@...ts.linaro.org,
	linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: greybus: audio: Limit scope of jack-related
 variables

On Tue, Jan 20, 2026 at 04:07:01PM +0900, Lee Yongjun wrote:
> Move jack-related variable declarations inside the CONFIG_SND_JACK
> conditional block.
> 
> These variables are only used when CONFIG_SND_JACK is enabled, so
> limiting their scope improves code clarity and avoids unused variable
> warnings when the option is disabled.
> 
> No functional changes intended.
> 
> Signed-off-by: Lee Yongjun <jun85566@...il.com>
> ---
>  drivers/staging/greybus/audio_codec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 444c53b4e08d..f752d5fbd685 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -935,8 +935,6 @@ static void gbaudio_codec_cleanup(struct gbaudio_module_info *module)
>  void gbaudio_unregister_module(struct gbaudio_module_info *module)
>  {
>  	struct snd_soc_component *comp = gbcodec->component;
> -	struct gbaudio_jack *jack, *n;
> -	int mask;
>  
>  	dev_dbg(comp->dev, "Unregister %s module\n", module->name);
>  
> @@ -948,6 +946,8 @@ void gbaudio_unregister_module(struct gbaudio_module_info *module)
>  	mutex_unlock(&gbcodec->lock);
>  
>  #ifdef CONFIG_SND_JACK
> +	struct gbaudio_jack *jack, *n;
> +	int mask;
>  	/* free jack devices for this module jack_list */

Please no, let's keep the variable definitions at the top of the scope
please.  The compiler will handle this just fine if they aren't used due
to the config option not being enabled.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ