public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Lee Yongjun <jun85566@gmail.com>
Cc: vaibhav.sr@gmail.com, mgreer@animalcreek.com, johan@kernel.org,
	elder@kernel.org, greybus-dev@lists.linaro.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: audio: Limit scope of jack-related variables
Date: Tue, 20 Jan 2026 08:09:53 +0100	[thread overview]
Message-ID: <2026012002-postal-fancy-8329@gregkh> (raw)
In-Reply-To: <20260120070701.3689-1-jun85566@gmail.com>

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@gmail.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

      reply	other threads:[~2026-01-20  7:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20  7:07 [PATCH] staging: greybus: audio: Limit scope of jack-related variables Lee Yongjun
2026-01-20  7:09 ` Greg KH [this message]

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=2026012002-postal-fancy-8329@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=elder@kernel.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=jun85566@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mgreer@animalcreek.com \
    --cc=vaibhav.sr@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox