Skip to contentSkip to conversation

drm/exynos: remove redundant of_match_ptr

PATCH In review Zhu Wang 3 participants 3 messages Jul 31, 2023 – Aug 4, 2023

Subsystems (3)
lore
Share & tools
lore

Zhu Wang

author
#0 lore raw

PATCH 1/1 drm/exynos: remove redundant of_match_ptr

The driver depends on CONFIG_OF, so it is not necessary to use of_match_ptr here.

Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Hence we remove of_match_ptr.

---
 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 -1
index 964dceb28c1e..34cdabc30b4f 100644
@@ -1426,6 +1426,6 @@ struct platform_driver gsc_driver = {
 		.name	= "exynos-drm-gsc",
 		.owner	= THIS_MODULE,
 		.pm	= &gsc_pm_ops,
-		.of_match_table = of_match_ptr(exynos_drm_gsc_of_match),
+		.of_match_table = exynos_drm_gsc_of_match,
 	},
 };
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Zhu Wang

The driver depends on CONFIG_OF, so it is not necessary to use of_match_ptr here.

Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Hence we remove of_match_ptr.

Best regards,
Krzysztof

#2 lore raw

2023년 7월 31일 (월) 오후 10:09, Krzysztof Kozlowski <
[email protected]>님이 작성:

Quoted 9 lines · Zhu Wang
Quoted 8 lines

The driver depends on CONFIG_OF, so it is not necessary to use of_match_ptr here.

Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Hence we remove of_match_ptr.

Quoted 5 lines
Quoted 1 line

Merged.

Thanks,
Inki Dae

Quoted 4 lines

Best regards,
Krzysztof