diff mbox series

clocksource/drivers/timer-ti-dm: Fix compile test warning

Message ID 20220815120334.51887-1-tony@atomide.com (mailing list archive)
State New, archived
Headers show
Series clocksource/drivers/timer-ti-dm: Fix compile test warning | expand

Commit Message

Tony Lindgren Aug. 15, 2022, 12:03 p.m. UTC
We can get a warning with COMPILE_TEST enabled for omap_timer_match
for 'omap_timer_match' defined but not used.

Fixes: ab0bbef3ae0f ("clocksource/drivers/timer-ti-dm: Make timer selectable for ARCH_K3")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/clocksource/timer-ti-dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Aug. 15, 2022, 12:44 p.m. UTC | #1
On Mon, Aug 15, 2022 at 2:03 PM Tony Lindgren <tony@atomide.com> wrote:
>
> We can get a warning with COMPILE_TEST enabled for omap_timer_match
> for 'omap_timer_match' defined but not used.
>
> Fixes: ab0bbef3ae0f ("clocksource/drivers/timer-ti-dm: Make timer selectable for ARCH_K3")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/clocksource/timer-ti-dm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
> --- a/drivers/clocksource/timer-ti-dm.c
> +++ b/drivers/clocksource/timer-ti-dm.c
> @@ -1040,7 +1040,7 @@ static const struct dmtimer_platform_data am6_pdata = {
>         .timer_ops = &dmtimer_ops,
>  };
>
> -static const struct of_device_id omap_timer_match[] = {
> +static const __maybe_unused struct of_device_id omap_timer_match[] = {
>         {
>                 .compatible = "ti,omap2420-timer",
>         },

I think a better way to address this is to remove the of_match_ptr()
usage from the driver. The only reason to use of_match_ptr() is to save
a few bytes on machines that don't have CONFIG_OF enabled, but this
driver is not used on such machines any more.

         Arnd
Tony Lindgren Aug. 15, 2022, 1:03 p.m. UTC | #2
* Arnd Bergmann <arnd@arndb.de> [220815 12:48]:
> On Mon, Aug 15, 2022 at 2:03 PM Tony Lindgren <tony@atomide.com> wrote:
> >
> > We can get a warning with COMPILE_TEST enabled for omap_timer_match
> > for 'omap_timer_match' defined but not used.
> >
> > Fixes: ab0bbef3ae0f ("clocksource/drivers/timer-ti-dm: Make timer selectable for ARCH_K3")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  drivers/clocksource/timer-ti-dm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
> > --- a/drivers/clocksource/timer-ti-dm.c
> > +++ b/drivers/clocksource/timer-ti-dm.c
> > @@ -1040,7 +1040,7 @@ static const struct dmtimer_platform_data am6_pdata = {
> >         .timer_ops = &dmtimer_ops,
> >  };
> >
> > -static const struct of_device_id omap_timer_match[] = {
> > +static const __maybe_unused struct of_device_id omap_timer_match[] = {
> >         {
> >                 .compatible = "ti,omap2420-timer",
> >         },
> 
> I think a better way to address this is to remove the of_match_ptr()
> usage from the driver. The only reason to use of_match_ptr() is to save
> a few bytes on machines that don't have CONFIG_OF enabled, but this
> driver is not used on such machines any more.

OK makes sense, will send v2 patch.

Thanks,

Tony
diff mbox series

Patch

diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -1040,7 +1040,7 @@  static const struct dmtimer_platform_data am6_pdata = {
 	.timer_ops = &dmtimer_ops,
 };
 
-static const struct of_device_id omap_timer_match[] = {
+static const __maybe_unused struct of_device_id omap_timer_match[] = {
 	{
 		.compatible = "ti,omap2420-timer",
 	},