Skip to contentSkip to conversation

drm/bridge: analogix_dp: Use str_supported_unsupported() helper

PATCH RESEND In review Thorsten Blum 2 participants 2 messages Nov 11 – Nov 12

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm/bridge: analogix_dp: Use str_supported_unsupported() helper

Replace hard-coded strings with the str_supported_unsupported() helper. This unifies the output and helps the linker with deduplication, which can result in a smaller binary.

---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +2 -1
index 6df6963740d2..59d3ff9bcde4 100644
@@ -19,6 +19,7 @@
 #include <linux/of.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
+#include <linux/string_choices.h>
 
 #include <drm/bridge/analogix_dp.h>
 #include <drm/display/drm_dp_aux_bus.h>
@@ -745,7 +746,7 @@ static int analogix_dp_fast_link_train_detection(struct analogix_dp_device *dp)
 	}
 	dp->fast_train_enable = !!(spread & DP_NO_AUX_HANDSHAKE_LINK_TRAINING);
 	dev_dbg(dp->dev, "fast link training %s\n",
-		dp->fast_train_enable ? "supported" : "unsupported");
+		str_supported_unsupported(dp->fast_train_enable));
 	return 0;
 }
 
Reviewed-by on v1 1/1
#1 lore raw

Hi Thorsten,

Quoted 24 lines · Thorsten Blum

Replace hard-coded strings with the str_supported_unsupported() helper. This unifies the output and helps the linker with deduplication, which can result in a smaller binary.

---
  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -0
index 6df6963740d2..59d3ff9bcde4 100644
@@ -19,6 +19,7 @@
  #include <linux/of.h>
  #include <linux/phy/phy.h>
  #include <linux/platform_device.h>
+#include <linux/string_choices.h>
 
  #include <drm/bridge/analogix_dp.h>
  #include <drm/display/drm_dp_aux_bus.h>

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_fast_link_train_detection(struct analogix_dp_device *dp) · line 752

Quoted 8 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -1
@@ -745,7 +746,7 @@ static int analogix_dp_fast_link_train_detection(struct analogix_dp_device *dp)
  	}
  	dp->fast_train_enable = !!(spread & DP_NO_AUX_HANDSHAKE_LINK_TRAINING);
  	dev_dbg(dp->dev, "fast link training %s\n",
-		dp->fast_train_enable ? "supported" : "unsupported");
+		str_supported_unsupported(dp->fast_train_enable));
  	return 0;
  }
 

Best regards,
Damon