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]
Date: Thu, 4 Apr 2024 15:30:26 +0200
From: Luca Ceresoli <luca.ceresoli@...tlin.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Mark Brown <broonie@...nel.org>, Arnd Bergmann <arnd@...db.de>, Liam
 Girdwood <lgirdwood@...il.com>, Jaroslav Kysela <perex@...ex.cz>, Takashi
 Iwai <tiwai@...e.com>, linux-sound@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: codecs: rk3308: fix building without CONFIG_OF

Hello Arnd,

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

> From: Arnd Bergmann <arnd@...db.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@...db.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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ