Skip to contentSkip to conversation

irqdomain: Use return value of strreplace()

PATCH Applied Andy Shevchenko 2 participants 2 messages Jun 28, 2023 – Jun 30, 2023

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

PATCH 1/1 irqdomain: Use return value of strreplace()

Since strreplace() returns the pointer to the string itself, we may use it directly in the code.

---
 kernel/irq/irqdomain.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/irq/irqdomain.c +1 -3
index 5bd01624e447..0bdef4fe925b 100644
@@ -182,9 +182,7 @@ static struct irq_domain *__irq_domain_create(struct fwnode_handle *fwnode,
 			return NULL;
 		}
 
-		strreplace(name, '/', ':');
-
-		domain->name = name;
+		domain->name = strreplace(name, '/', ':');
 		domain->fwnode = fwnode;
 		domain->flags |= IRQ_DOMAIN_NAME_ALLOCATED;
 	}
Signature · 1 line
2.40.0.1.gaa8946217a0b
#1 lore raw
The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     67a4e1a3bf7c68ed3fbefc4213648165d912cabb
Gitweb:        https://git.kernel.org/tip/67a4e1a3bf7c68ed3fbefc4213648165d912cabb
Author:        Andy Shevchenko <[email protected]>
AuthorDate:    Wed, 28 Jun 2023 18:02:51 +03:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 30 Jun 2023 11:13:44 +02:00

irqdomain: Use return value of strreplace()

Since strreplace() returns the pointer to the string itself, use it directly.

---
 kernel/irq/irqdomain.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/irq/irqdomain.c +1 -3
index 5bd0162..0bdef4f 100644
@@ -182,9 +182,7 @@ static struct irq_domain *__irq_domain_create(struct fwnode_handle *fwnode,
 			return NULL;
 		}
 
-		strreplace(name, '/', ':');
-
-		domain->name = name;
+		domain->name = strreplace(name, '/', ':');
 		domain->fwnode = fwnode;
 		domain->flags |= IRQ_DOMAIN_NAME_ALLOCATED;
 	}