linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource/drivers/timer-ti-dm: Fix compile test warning
@ 2022-08-15 12:03 Tony Lindgren
  2022-08-15 12:44 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2022-08-15 12:03 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner
  Cc: linux-kernel, linux-omap, linux-arm-kernel, kernel test robot

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",
 	},
-- 
2.37.1

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

* Re: [PATCH] clocksource/drivers/timer-ti-dm: Fix compile test warning
  2022-08-15 12:03 [PATCH] clocksource/drivers/timer-ti-dm: Fix compile test warning Tony Lindgren
@ 2022-08-15 12:44 ` Arnd Bergmann
  2022-08-15 13:03   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2022-08-15 12:44 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Daniel Lezcano, Thomas Gleixner, linux-kernel, linux-omap,
	linux-arm-kernel, kernel test robot

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

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

* Re: [PATCH] clocksource/drivers/timer-ti-dm: Fix compile test warning
  2022-08-15 12:44 ` Arnd Bergmann
@ 2022-08-15 13:03   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2022-08-15 13:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Lezcano, Thomas Gleixner, linux-kernel, linux-omap,
	linux-arm-kernel, kernel test robot

* 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

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

end of thread, other threads:[~2022-08-15 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 12:03 [PATCH] clocksource/drivers/timer-ti-dm: Fix compile test warning Tony Lindgren
2022-08-15 12:44 ` Arnd Bergmann
2022-08-15 13:03   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).