2021-02-02 11:26:06

by Alexandre Belloni

[permalink] [raw]
Subject: [PATCH 05/21] rtc: digicolor: quiet maybe-unused variable warning

When CONFIG_OF is disabled then the matching table is not referenced.

Signed-off-by: Alexandre Belloni <[email protected]>
---
drivers/rtc/rtc-digicolor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc/rtc-digicolor.c
index 4fdfa5b6feb2..218a6de19247 100644
--- a/drivers/rtc/rtc-digicolor.c
+++ b/drivers/rtc/rtc-digicolor.c
@@ -205,7 +205,7 @@ static int __init dc_rtc_probe(struct platform_device *pdev)
return devm_rtc_register_device(rtc->rtc_dev);
}

-static const struct of_device_id dc_dt_ids[] = {
+static const __maybe_unused struct of_device_id dc_dt_ids[] = {
{ .compatible = "cnxt,cx92755-rtc" },
{ /* sentinel */ }
};
--
2.29.2


2021-02-02 11:38:01

by Baruch Siach

[permalink] [raw]
Subject: Re: [PATCH 05/21] rtc: digicolor: quiet maybe-unused variable warning

Hi Alex,

On Tue, Feb 02 2021, Alexandre Belloni wrote:

> When CONFIG_OF is disabled then the matching table is not referenced.
>
> Signed-off-by: Alexandre Belloni <[email protected]>

Acked-by: Baruch Siach <[email protected]>

Thanks,
baruch

> ---
> drivers/rtc/rtc-digicolor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc/rtc-digicolor.c
> index 4fdfa5b6feb2..218a6de19247 100644
> --- a/drivers/rtc/rtc-digicolor.c
> +++ b/drivers/rtc/rtc-digicolor.c
> @@ -205,7 +205,7 @@ static int __init dc_rtc_probe(struct platform_device *pdev)
> return devm_rtc_register_device(rtc->rtc_dev);
> }
>
> -static const struct of_device_id dc_dt_ids[] = {
> +static const __maybe_unused struct of_device_id dc_dt_ids[] = {
> { .compatible = "cnxt,cx92755-rtc" },
> { /* sentinel */ }
> };


--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -