Re: [PATCH 1/2] soc: renesas: mark OF related data as maybe unused

From: Geert Uytterhoeven
Date: Mon Mar 13 2023 - 08:34:31 EST


Hi Krzysztof,

Thanks for your patch!

On Sun, Mar 12, 2023 at 2:26 PM Krzysztof Kozlowski
<krzysztof.kozlowski@xxxxxxxxxx> wrote:
> The driver can be compile tested with !CONFIG_OF making certain data
> unused:
>
> drivers/soc/renesas/renesas-soc.c:272:34: error: ‘renesas_socs’ defined but not used [-Werror=unused-const-variable=]

Where do you see this issue?
This variable is used unconditionally, and the driver builds fine for
me for m68k/allmodconfig+CONFIG_OF=n?

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>

> --- a/drivers/soc/renesas/renesas-soc.c
> +++ b/drivers/soc/renesas/renesas-soc.c
> @@ -269,7 +269,7 @@ static const struct renesas_soc soc_shmobile_ag5 __initconst __maybe_unused = {
> };
>
>
> -static const struct of_device_id renesas_socs[] __initconst = {
> +static const struct of_device_id renesas_socs[] __initconst __maybe_unused = {
> #ifdef CONFIG_ARCH_R7S72100
> { .compatible = "renesas,r7s72100", .data = &soc_rz_a1h },
> #endif

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds