Skip to contentSkip to conversation

drm/debugfs: Drop conditionals around of_node pointers

PATCH Superseded Sui Jingfeng 5 participants 7 messages Mar 21, 2024 – May 1, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/debugfs: Drop conditionals around of_node pointers

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify debugfs.

Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")
---
 drivers/gpu/drm/drm_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_debugfs.c +2 -2
index 08fcefd804bc..28a471fe4bc8 100644
@@ -597,10 +597,10 @@ static int bridges_show(struct seq_file *m, void *data)
 		drm_printf(&p, "\ttype: [%d] %s\n",
 			   bridge->type,
 			   drm_get_connector_type_name(bridge->type));
-#ifdef CONFIG_OF
+
 		if (bridge->of_node)
 			drm_printf(&p, "\tOF: %pOFfc\n", bridge->of_node);
-#endif
+
 		drm_printf(&p, "\tops: [0x%x]", bridge->ops);
 		if (bridge->ops & DRM_BRIDGE_OP_DETECT)
 			drm_puts(&p, " detect");
Signature · 1 line
2.34.1
#1 lore raw

ping

Quoted 27 lines · Sui Jingfeng

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify debugfs.

Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")
---
  drivers/gpu/drm/drm_debugfs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_debugfs.c +2 -2
index 08fcefd804bc..28a471fe4bc8 100644
@@ -597,10 +597,10 @@ static int bridges_show(struct seq_file *m, void *data)
  		drm_printf(&p, "\ttype: [%d] %s\n",
  			   bridge->type,
  			   drm_get_connector_type_name(bridge->type));
-#ifdef CONFIG_OF
+
  		if (bridge->of_node)
  			drm_printf(&p, "\tOF: %pOFfc\n", bridge->of_node);
-#endif
+
  		drm_printf(&p, "\tops: [0x%x]", bridge->ops);
  		if (bridge->ops & DRM_BRIDGE_OP_DETECT)
  			drm_puts(&p, " detect");
Signature · 2 lines
Best regards
Sui Jingfeng
maintainer
#2 lore raw
Quoted 5 lines · Sui Jingfeng

ping

Quoted 2 lines · Sui Jingfeng

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks.

The code being ugly is an opinion, what problem is it causing exactly?

Quoted 1 line

Drop the conditionals to simplify debugfs.

What does it simplifies?

Quoted 3 lines
Quoted 3 lines
Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")

Why do we want to backport that patch to stable?

Maxime

#3 lore raw

Hi,

Quoted 18 lines

-----原始邮件-----
发件人: "Maxime Ripard" <[email protected]>
发送时间: 2024-04-29 19:30:24 (星期一)
收件人: "Sui Jingfeng" <[email protected]>
抄送: "Sui Jingfeng" <[email protected]>, "Maarten Lankhorst" <[email protected]>, "Thomas Zimmermann" <[email protected]>, "David Airlie" <[email protected]>, "Daniel Vetter" <[email protected]>, "Douglas Anderson" <[email protected]>, "Laurent Pinchart" <[email protected]>, "Biju Das" <[email protected]>, [email protected], [email protected] 主题: Re: drm/debugfs: Drop conditionals around of_node pointers

Quoted 5 lines · Sui Jingfeng

ping

Quoted 2 lines · Sui Jingfeng

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks.

The code being ugly is an opinion, what problem is it causing exactly?

Quoted 1 line

Drop the conditionals to simplify debugfs.

Quoted 7 lines

What does it simplifies?

Quoted 3 lines
Quoted 3 lines
Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")

Why do we want to backport that patch to stable?

My commit message is written based on commit of d8dfccde2709

$ git show c9e358dfc4a8

This patch is based on commit c9e358dfc4a8 ("driver-core: remove conditionals around devicetree pointers").

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify drivers. While this slightly increases the size of struct drm_bridge on non-OF system, the number of bridges used today and foreseen tomorrow on those systems is very low, so this shouldn't be an issue.

So drop #if conditionals by adding struct device_node forward declaration.

Quoted 1 line

Maxime

I'm just start to contribute by mimic other people's tone, there seems no need to over read.

#4 lore raw

Hi,

Quoted 29 lines · 隋景峰

Hi,

Quoted 25 lines

-----原始邮件-----
发件人: "Maxime Ripard" <[email protected]>
发送时间: 2024-04-29 19:30:24 (星期一)
收件人: "Sui Jingfeng" <[email protected]>
抄送: "Sui Jingfeng" <[email protected]>, "Maarten Lankhorst" <[email protected]>, "Thomas Zimmermann" <[email protected]>, "David Airlie" <[email protected]>, "Daniel Vetter" <[email protected]>, "Douglas Anderson" <[email protected]>, "Laurent Pinchart" <[email protected]>, "Biju Das" <[email protected]>, [email protected], [email protected] 主题: Re: drm/debugfs: Drop conditionals around of_node pointers

Quoted 5 lines · Sui Jingfeng

ping

Quoted 2 lines · Sui Jingfeng

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks.

The code being ugly is an opinion, what problem is it causing exactly?

Quoted 1 line

Drop the conditionals to simplify debugfs.

What does it simplifies?

Quoted 3 lines
Quoted 3 lines
Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")

Why do we want to backport that patch to stable?

Technically it's not CCing stable and so it's not really incorrect. ...but I agree that this is a bit of a stretch to call it a "Fix". Maybe drop the "Fixes" line?

Quoted 14 lines

My commit message is written based on commit of d8dfccde2709

$ git show c9e358dfc4a8

This patch is based on commit c9e358dfc4a8 ("driver-core: remove conditionals around devicetree pointers").

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify drivers. While this slightly increases the size of struct drm_bridge on non-OF system, the number of bridges used today and foreseen tomorrow on those systems is very low, so this shouldn't be an issue.

Quoted 6 lines

So drop #if conditionals by adding struct device_node forward declaration.

Quoted 1 line

Maxime

I'm just start to contribute by mimic other people's tone, there seems no need to over read.

I think the fact that you skipped the reference to commit c9e358dfc4a8 ("driver-core: remove conditionals around devicetree pointers") was relevant here. Referencing that commit makes it easy for the reader to see that you are following convention used throughout the kernel and not just asserting your own opinion about style.

If you add that reference into your commit message and send a v2, I'm happy to apply it.

-Doug

#5 lore raw

Hi,

Quoted 22 lines · Doug Anderson

Hi,

Quoted 19 lines · 隋景峰

Hi,

Quoted 16 lines

-----原始邮件-----
发件人: "Maxime Ripard" <[email protected]>
发送时间: 2024-04-29 19:30:24 (星期一)
收件人: "Sui Jingfeng" <[email protected]>
抄送: "Sui Jingfeng" <[email protected]>, "Maarten Lankhorst" <[email protected]>, "Thomas Zimmermann" <[email protected]>, "David Airlie" <[email protected]>, "Daniel Vetter" <[email protected]>, "Douglas Anderson" <[email protected]>, "Laurent Pinchart" <[email protected]>, "Biju Das" <[email protected]>, [email protected], [email protected] 主题: Re: drm/debugfs: Drop conditionals around of_node pointers

Quoted 5 lines · Sui Jingfeng

ping

Quoted 2 lines · Sui Jingfeng

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks.

The code being ugly is an opinion, what problem is it causing exactly?

Quoted 1 line

Drop the conditionals to simplify debugfs.

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

What does it simplifies?

Quoted 2 lines
Quoted 2 lines
Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")

Why do we want to backport that patch to stable?

Technically it's not CCing stable and so it's not really incorrect. ...but I agree that this is a bit of a stretch to call it a "Fix". Maybe drop the "Fixes" line?

OK, good idea, acceptable.

Originally, I add the fix tag to hint that my modification belongs to the commit d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers") too. But get missed.

Quoted 20 lines
Quoted 15 lines

My commit message is written based on commit of d8dfccde2709

$ git show c9e358dfc4a8

This patch is based on commit c9e358dfc4a8 ("driver-core: remove conditionals around devicetree pointers").

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify drivers. While this slightly increases the size of struct drm_bridge on non-OF system, the number of bridges used today and foreseen tomorrow on those systems is very low, so this shouldn't be an issue.

Quoted 5 lines

So drop #if conditionals by adding struct device_node forward declaration.

Quoted 1 line

Maxime

I'm just start to contribute by mimic other people's tone, there seems no need to over read.

Quoted 8 lines

I think the fact that you skipped the reference to commit c9e358dfc4a8 ("driver-core: remove conditionals around devicetree pointers") was relevant here. Referencing that commit makes it easy for the reader to see that you are following convention used throughout the kernel and not just asserting your own opinion about style.

If you add that reference into your commit message and send a v2, I'm happy to apply it.

OK, thanks a lot.

Quoted 1 line

-Doug

Signature · 2 lines
Best regards,
Sui
Reviewed-by on v1 1/1
#6 lore raw
In reply to Sui Jingfeng
Quoted 10 lines · Sui Jingfeng

Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify debugfs.

Fixes d8dfccde2709 ("drm/bridge: Drop conditionals around of_node pointers")
---
 drivers/gpu/drm/drm_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
With best wishes
Dmitry