[PATCH v1 2/2] irqdomain: Remove stray '-' in the IRQ domain name

Andy Shevchenko posted 2 patches 1 year, 5 months ago
[PATCH v1 2/2] irqdomain: Remove stray '-' in the IRQ domain name
Posted by Andy Shevchenko 1 year, 5 months ago
When domain suffix is not supplied the fwnode case (not irqchip-fwnode)
uses alloc_fwnode_name(). This currently unconditionally adds a
separator. Fix the logic to make it conditional and drop stray '-' in
the IRQ domain name.

Fixes: 1e7c05292531 ("irqdomain: Allow giving name suffix for domain")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 kernel/irq/irqdomain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 18d253e10e87..1acc5308fcb7 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -149,9 +149,9 @@ static int alloc_fwnode_name(struct irq_domain *domain, const struct fwnode_hand
 	char *name;
 
 	if (bus_token == DOMAIN_BUS_ANY)
-		name = kasprintf(GFP_KERNEL, "%pfw-%s", fwnode, suf);
+		name = kasprintf(GFP_KERNEL, "%pfw%s%s", fwnode, sep, suf);
 	else
-		name = kasprintf(GFP_KERNEL, "%pfw-%s%s%d", fwnode, suf, sep, bus_token);
+		name = kasprintf(GFP_KERNEL, "%pfw%s%s-%d", fwnode, sep, suf, bus_token);
 	if (!name)
 		return -ENOMEM;
 
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 2/2] irqdomain: Remove stray '-' in the IRQ domain name
Posted by Matti Vaittinen 1 year, 5 months ago
On 8/12/24 22:29, Andy Shevchenko wrote:
> When domain suffix is not supplied the fwnode case (not irqchip-fwnode)
> uses alloc_fwnode_name(). This currently unconditionally adds a
> separator. Fix the logic to make it conditional and drop stray '-' in
> the IRQ domain name.
> 
> Fixes: 1e7c05292531 ("irqdomain: Allow giving name suffix for domain")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks Andy.

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

Yours,
	-- Matti

-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~
[tip: irq/core] irqdomain: Remove stray '-' in the domain name
Posted by tip-bot2 for Andy Shevchenko 1 year, 5 months ago
The following commit has been merged into the irq/core branch of tip:

Commit-ID:     7b9414cb2d370b7c5149b37f585b077af2ae211b
Gitweb:        https://git.kernel.org/tip/7b9414cb2d370b7c5149b37f585b077af2ae211b
Author:        Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate:    Mon, 12 Aug 2024 22:29:40 +03:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 13 Aug 2024 10:40:10 +02:00

irqdomain: Remove stray '-' in the domain name

When the domain suffix is not supplied alloc_fwnode_name() unconditionally
adds a separator.

Fix the format strings to get rid of the stray '-' separator.

Fixes: 1e7c05292531 ("irqdomain: Allow giving name suffix for domain")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240812193101.1266625-3-andriy.shevchenko@linux.intel.com

---
 kernel/irq/irqdomain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 18d253e..1acc530 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -149,9 +149,9 @@ static int alloc_fwnode_name(struct irq_domain *domain, const struct fwnode_hand
 	char *name;
 
 	if (bus_token == DOMAIN_BUS_ANY)
-		name = kasprintf(GFP_KERNEL, "%pfw-%s", fwnode, suf);
+		name = kasprintf(GFP_KERNEL, "%pfw%s%s", fwnode, sep, suf);
 	else
-		name = kasprintf(GFP_KERNEL, "%pfw-%s%s%d", fwnode, suf, sep, bus_token);
+		name = kasprintf(GFP_KERNEL, "%pfw%s%s-%d", fwnode, sep, suf, bus_token);
 	if (!name)
 		return -ENOMEM;