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