public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF
@ 2024-04-04  9:57 Arnd Bergmann
  2024-04-04 13:30 ` Luca Ceresoli
  2024-04-04 14:31 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2024-04-04  9:57 UTC (permalink / raw)
  To: Luca Ceresoli, Mark Brown
  Cc: Arnd Bergmann, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The newly added codec has an extraneous of_match_ptr() annotation for
the ID table:

sound/soc/codecs/rk3308_codec.c:956:34: error: 'rk3308_codec_of_match' defined but not used [-Werror=unused-const-variable=]
  956 | static const struct of_device_id rk3308_codec_of_match[] = {

Remove it to avoid introducing a warning when -Wunused-const-variable
gets enabled by default:

Fixes: 4ed0915f5bc4 ("ASoC: codecs: Add RK3308 internal audio codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/codecs/rk3308_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rk3308_codec.c b/sound/soc/codecs/rk3308_codec.c
index 9d3e4691a7b5..6b1cb92997b4 100644
--- a/sound/soc/codecs/rk3308_codec.c
+++ b/sound/soc/codecs/rk3308_codec.c
@@ -962,7 +962,7 @@ MODULE_DEVICE_TABLE(of, rk3308_codec_of_match);
 static struct platform_driver rk3308_codec_driver = {
 	.driver = {
 		.name = "rk3308-acodec",
-		.of_match_table = of_match_ptr(rk3308_codec_of_match),
+		.of_match_table = rk3308_codec_of_match,
 	},
 	.probe = rk3308_codec_platform_probe,
 };
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF
  2024-04-04  9:57 [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF Arnd Bergmann
@ 2024-04-04 13:30 ` Luca Ceresoli
  2024-04-04 13:46   ` Arnd Bergmann
  2024-04-04 14:31 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Luca Ceresoli @ 2024-04-04 13:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Arnd Bergmann, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, linux-sound, linux-kernel

Hello Arnd,

On Thu,  4 Apr 2024 11:57:34 +0200
Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> The newly added codec has an extraneous of_match_ptr() annotation for
> the ID table:
> 
> sound/soc/codecs/rk3308_codec.c:956:34: error: 'rk3308_codec_of_match' defined but not used [-Werror=unused-const-variable=]
>   956 | static const struct of_device_id rk3308_codec_of_match[] = {
> 
> Remove it to avoid introducing a warning when -Wunused-const-variable
> gets enabled by default:
> 
> Fixes: 4ed0915f5bc4 ("ASoC: codecs: Add RK3308 internal audio codec driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  sound/soc/codecs/rk3308_codec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/rk3308_codec.c b/sound/soc/codecs/rk3308_codec.c
> index 9d3e4691a7b5..6b1cb92997b4 100644
> --- a/sound/soc/codecs/rk3308_codec.c
> +++ b/sound/soc/codecs/rk3308_codec.c
> @@ -962,7 +962,7 @@ MODULE_DEVICE_TABLE(of, rk3308_codec_of_match);
>  static struct platform_driver rk3308_codec_driver = {
>  	.driver = {
>  		.name = "rk3308-acodec",
> -		.of_match_table = of_match_ptr(rk3308_codec_of_match),
> +		.of_match_table = rk3308_codec_of_match,

Thanks for your report!

The warning has already been reported by the kernel test robot
<lkp@intel.com> and I have sent a patch to fix it:
https://lore.kernel.org/linux-sound/20240403-rk3308-audio-codec-fix-warning-v2-1-816bae4c1dc5@bootlin.com/

The approach I took is different though: I have added __maybe_unused
instead, which has the advantage of not adding a struct of_device_id
array to kernel built without CONFIG_OF.

My patch has already been taken by Mark. I hope this is fine as well for
you.

Best regards,
Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF
  2024-04-04 13:30 ` Luca Ceresoli
@ 2024-04-04 13:46   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2024-04-04 13:46 UTC (permalink / raw)
  To: Luca Ceresoli, Arnd Bergmann
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linux-kernel

On Thu, Apr 4, 2024, at 15:30, Luca Ceresoli wrote:
> On Thu,  4 Apr 2024 11:57:34 +0200
>
> Thanks for your report!
>
> The warning has already been reported by the kernel test robot
> <lkp@intel.com> and I have sent a patch to fix it:
> https://lore.kernel.org/linux-sound/20240403-rk3308-audio-codec-fix-warning-v2-1-816bae4c1dc5@bootlin.com/
>
> The approach I took is different though: I have added __maybe_unused
> instead, which has the advantage of not adding a struct of_device_id
> array to kernel built without CONFIG_OF.
>
> My patch has already been taken by Mark. I hope this is fine as well for
> you.

We can clean it up later. Adding __maybe_unused is completely
pointless here, as the purpose of the of_match_ptr() macro
is just to deal with ID tables that were hidden behind an
#ifdef, which yours is not.

     Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF
  2024-04-04  9:57 [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF Arnd Bergmann
  2024-04-04 13:30 ` Luca Ceresoli
@ 2024-04-04 14:31 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-04-04 14:31 UTC (permalink / raw)
  To: Luca Ceresoli, Arnd Bergmann
  Cc: Arnd Bergmann, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linux-kernel

On Thu, 04 Apr 2024 11:57:34 +0200, Arnd Bergmann wrote:
> The newly added codec has an extraneous of_match_ptr() annotation for
> the ID table:
> 
> sound/soc/codecs/rk3308_codec.c:956:34: error: 'rk3308_codec_of_match' defined but not used [-Werror=unused-const-variable=]
>   956 | static const struct of_device_id rk3308_codec_of_match[] = {
> 
> Remove it to avoid introducing a warning when -Wunused-const-variable
> gets enabled by default:
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: codecs: rk3308: fix building without CONFIG_OF
      commit: 2ba2d17170f9e415fc31d7978214f0f26e8afc64

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-04 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04  9:57 [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF Arnd Bergmann
2024-04-04 13:30 ` Luca Ceresoli
2024-04-04 13:46   ` Arnd Bergmann
2024-04-04 14:31 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox