All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: armada: simplify name sanitization
@ 2024-03-20 10:49 Rasmus Villemoes
  2024-03-21  7:13 ` Miquel Raynal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2024-03-20 10:49 UTC (permalink / raw
  To: Miquel Raynal, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba
  Cc: Rasmus Villemoes, linux-pm, linux-kernel

Simplify the code by using the helper we have for doing exactly this.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/thermal/armada_thermal.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index f783547ef964..fdcb077cfd54 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -763,7 +763,6 @@ static void armada_set_sane_name(struct platform_device *pdev,
 				 struct armada_thermal_priv *priv)
 {
 	const char *name = dev_name(&pdev->dev);
-	char *insane_char;
 
 	if (strlen(name) > THERMAL_NAME_LENGTH) {
 		/*
@@ -781,12 +780,8 @@ static void armada_set_sane_name(struct platform_device *pdev,
 	/* Save the name locally */
 	strscpy(priv->zone_name, name, THERMAL_NAME_LENGTH);
 
-	/* Then check there are no '-' or hwmon core will complain */
-	do {
-		insane_char = strpbrk(priv->zone_name, "-");
-		if (insane_char)
-			*insane_char = '_';
-	} while (insane_char);
+	/* Then ensure there are no '-' or hwmon core will complain */
+	strreplace(priv->zone_name, '-', '_');
 }
 
 /*
-- 
2.40.1.1.g1c60b9335d


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

* Re: [PATCH] thermal: armada: simplify name sanitization
  2024-03-20 10:49 [PATCH] thermal: armada: simplify name sanitization Rasmus Villemoes
@ 2024-03-21  7:13 ` Miquel Raynal
  2024-03-21 17:15 ` Daniel Lezcano
  2024-05-14 10:18 ` [thermal: thermal/fixes] thermal/drivers/armada: Simplify " thermal-bot for Rasmus Villemoes
  2 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2024-03-21  7:13 UTC (permalink / raw
  To: Rasmus Villemoes
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	linux-pm, linux-kernel

Hi Rasmus,

linux@rasmusvillemoes.dk wrote on Wed, 20 Mar 2024 11:49:39 +0100:

> Simplify the code by using the helper we have for doing exactly this.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


Thanks,
Miquèl

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

* Re: [PATCH] thermal: armada: simplify name sanitization
  2024-03-20 10:49 [PATCH] thermal: armada: simplify name sanitization Rasmus Villemoes
  2024-03-21  7:13 ` Miquel Raynal
@ 2024-03-21 17:15 ` Daniel Lezcano
  2024-05-14 10:18 ` [thermal: thermal/fixes] thermal/drivers/armada: Simplify " thermal-bot for Rasmus Villemoes
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2024-03-21 17:15 UTC (permalink / raw
  To: Rasmus Villemoes, Miquel Raynal, Rafael J. Wysocki, Zhang Rui,
	Lukasz Luba
  Cc: linux-pm, linux-kernel

On 20/03/2024 11:49, Rasmus Villemoes wrote:
> Simplify the code by using the helper we have for doing exactly this.
> 
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---

Applied, thanks

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* [thermal: thermal/fixes] thermal/drivers/armada: Simplify name sanitization
  2024-03-20 10:49 [PATCH] thermal: armada: simplify name sanitization Rasmus Villemoes
  2024-03-21  7:13 ` Miquel Raynal
  2024-03-21 17:15 ` Daniel Lezcano
@ 2024-05-14 10:18 ` thermal-bot for Rasmus Villemoes
  2 siblings, 0 replies; 4+ messages in thread
From: thermal-bot for Rasmus Villemoes @ 2024-05-14 10:18 UTC (permalink / raw
  To: linux-pm
  Cc: Rasmus Villemoes, Miquel Raynal, Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/fixes branch of thermal:

Commit-ID:     58b1569244fea51cbf675774fad9423359d76c57
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//58b1569244fea51cbf675774fad9423359d76c57
Author:        Rasmus Villemoes <linux@rasmusvillemoes.dk>
AuthorDate:    Wed, 20 Mar 2024 11:49:39 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 23 Apr 2024 12:40:29 +02:00

thermal/drivers/armada: Simplify name sanitization

Simplify the code by using the helper we have for doing exactly this.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240320104940.65031-1-linux@rasmusvillemoes.dk
---
 drivers/thermal/armada_thermal.c |  9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index f783547..fdcb077 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -763,7 +763,6 @@ static void armada_set_sane_name(struct platform_device *pdev,
 				 struct armada_thermal_priv *priv)
 {
 	const char *name = dev_name(&pdev->dev);
-	char *insane_char;
 
 	if (strlen(name) > THERMAL_NAME_LENGTH) {
 		/*
@@ -781,12 +780,8 @@ static void armada_set_sane_name(struct platform_device *pdev,
 	/* Save the name locally */
 	strscpy(priv->zone_name, name, THERMAL_NAME_LENGTH);
 
-	/* Then check there are no '-' or hwmon core will complain */
-	do {
-		insane_char = strpbrk(priv->zone_name, "-");
-		if (insane_char)
-			*insane_char = '_';
-	} while (insane_char);
+	/* Then ensure there are no '-' or hwmon core will complain */
+	strreplace(priv->zone_name, '-', '_');
 }
 
 /*

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

end of thread, other threads:[~2024-05-14 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20 10:49 [PATCH] thermal: armada: simplify name sanitization Rasmus Villemoes
2024-03-21  7:13 ` Miquel Raynal
2024-03-21 17:15 ` Daniel Lezcano
2024-05-14 10:18 ` [thermal: thermal/fixes] thermal/drivers/armada: Simplify " thermal-bot for Rasmus Villemoes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.