Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast}
@ 2026-05-21 19:46 Thorsten Blum
  2026-05-21 19:47 ` [PATCH 2/2] drm/tegra: sor: use str_plural in tegra_sor_dp_link_configure Thorsten Blum
  2026-05-28 12:09 ` [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast} Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-05-21 19:46 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen, David Airlie, Simona Vetter,
	Jonathan Hunter
  Cc: Thorsten Blum, dri-devel, linux-tegra, linux-kernel

Replace the manual ternary "s" pluralizations with str_plural() to
simplify the code. This also corrects the "0 lanes" case.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/gpu/drm/tegra/dp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dp.c b/drivers/gpu/drm/tegra/dp.c
index 990e744b0923..3cb194f5ce36 100644
--- a/drivers/gpu/drm/tegra/dp.c
+++ b/drivers/gpu/drm/tegra/dp.c
@@ -4,6 +4,8 @@
  * Copyright (C) 2015 Rob Clark
  */
 
+#include <linux/string_choices.h>
+
 #include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_print.h>
@@ -668,7 +670,7 @@ static int drm_dp_link_train_full(struct drm_dp_link *link)
 
 retry:
 	DRM_DEBUG_KMS("full-training link: %u lane%s at %u MHz\n",
-		      link->lanes, (link->lanes > 1) ? "s" : "",
+		      link->lanes, str_plural(link->lanes),
 		      link->rate / 100);
 
 	err = drm_dp_link_configure(link->aux, link);
@@ -724,7 +726,7 @@ static int drm_dp_link_train_fast(struct drm_dp_link *link)
 	int err;
 
 	DRM_DEBUG_KMS("fast-training link: %u lane%s at %u MHz\n",
-		      link->lanes, (link->lanes > 1) ? "s" : "",
+		      link->lanes, str_plural(link->lanes),
 		      link->rate / 100);
 
 	err = drm_dp_link_configure(link->aux, link);

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

* [PATCH 2/2] drm/tegra: sor: use str_plural in tegra_sor_dp_link_configure
  2026-05-21 19:46 [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast} Thorsten Blum
@ 2026-05-21 19:47 ` Thorsten Blum
  2026-05-28 12:09 ` [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast} Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-05-21 19:47 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen, David Airlie, Simona Vetter,
	Jonathan Hunter
  Cc: Thorsten Blum, dri-devel, linux-tegra, linux-kernel

Replace the manual ternary "s" pluralization with str_plural() to
simplify the code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/gpu/drm/tegra/sor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index de8b2dfc4984..93e5ffd4f206 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -13,6 +13,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
+#include <linux/string_choices.h>
 
 #include <soc/tegra/pmc.h>
 
@@ -940,7 +941,7 @@ static int tegra_sor_dp_link_configure(struct drm_dp_link *link)
 	err = tegra_sor_power_up_lanes(sor, lanes);
 	if (err < 0) {
 		dev_err(sor->dev, "failed to power up %u lane%s: %d\n",
-			lanes, (lanes != 1) ? "s" : "", err);
+			lanes, str_plural(lanes), err);
 		return err;
 	}
 

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

* Re: [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast}
  2026-05-21 19:46 [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast} Thorsten Blum
  2026-05-21 19:47 ` [PATCH 2/2] drm/tegra: sor: use str_plural in tegra_sor_dp_link_configure Thorsten Blum
@ 2026-05-28 12:09 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2026-05-28 12:09 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Mikko Perttunen, David Airlie, Simona Vetter, Jonathan Hunter,
	dri-devel, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Thu, May 21, 2026 at 09:46:59PM +0200, Thorsten Blum wrote:
> Replace the manual ternary "s" pluralizations with str_plural() to
> simplify the code. This also corrects the "0 lanes" case.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/gpu/drm/tegra/dp.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Both patches applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2026-05-28 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 19:46 [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast} Thorsten Blum
2026-05-21 19:47 ` [PATCH 2/2] drm/tegra: sor: use str_plural in tegra_sor_dp_link_configure Thorsten Blum
2026-05-28 12:09 ` [PATCH 1/2] drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast} Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox