Skip to contentSkip to conversation

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

PATCH Superseded Tony Lindgren 2 participants 3 messages Aug 15, 2022 Clocksource, clockevent drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

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")
---
 drivers/clocksource/timer-ti-dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-ti-dm.c +1 -1
@@ -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",
 	},
Signature · 1 line
2.37.1
#1 lore raw
Quoted 15 lines · Tony Lindgren

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")
---
 drivers/clocksource/timer-ti-dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/clocksource/timer-ti-dm.c static const struct dmtimer_platform_data am6_pdata = { · line 1046

Quoted 8 lines
drivers/clocksource/timer-ti-dm.c +1 -1
@@ -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

#2 lore raw
Quoted 19 lines · Arnd Bergmann
Quoted 18 lines · Tony Lindgren

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")
---
 drivers/clocksource/timer-ti-dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-ti-dm.c +0 -0
@@ -1040,7 +1040,7 @@ static const struct dmtimer_platform_data am6_pdata = {
        .timer_ops = &dmtimer_ops,
 };
 
Quoted 10 lines

drivers/clocksource/timer-ti-dm.c static const struct dmtimer_platform_data am6_pdata = { · line 1046

Quoted 5 lines
drivers/clocksource/timer-ti-dm.c +1 -1
-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