Skip to contentSkip to conversation

genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()

PATCH Applied Thorsten Blum 2 participants 2 messages Oct 26, 2024 – Oct 27, 2024 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()

Remove hard-coded strings by using the str_enabled_disabled() helper function.

---
 kernel/irq/irqdesc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/irqdesc.c +2 -1
index 1dee88ba0ae4..a135b2ce886f 100644
@@ -15,6 +15,7 @@
 #include <linux/maple_tree.h>
 #include <linux/irqdomain.h>
 #include <linux/sysfs.h>
+#include <linux/string_choices.h>
 
 #include "internals.h"
 
@@ -299,7 +300,7 @@ static ssize_t wakeup_show(struct kobject *kobj,
 
 	raw_spin_lock_irq(&desc->lock);
 	ret = sprintf(buf, "%s\n",
-		      irqd_is_wakeup_set(&desc->irq_data) ? "enabled" : "disabled");
+		      str_enabled_disabled(irqd_is_wakeup_set(&desc->irq_data)));
 	raw_spin_unlock_irq(&desc->lock);
 
 	return ret;
Signature · 1 line
2.47.0
merge bot Applied
#1 lore raw
The following commit has been merged into the irq/core branch of tip:

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

Commit-ID:     d1a128bc3057a090b97ab5a9f938874df3d3f124
Gitweb:        https://git.kernel.org/tip/d1a128bc3057a090b97ab5a9f938874df3d3f124
Author:        Thorsten Blum <[email protected]>
AuthorDate:    Sat, 26 Oct 2024 17:40:29 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 27 Oct 2024 10:42:09 +01:00

genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()

Remove hard-coded strings by using the str_enabled_disabled() helper function.

---
 kernel/irq/irqdesc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/irqdesc.c +2 -2
index 479cf1c..0253e77 100644
@@ -15,6 +15,7 @@
 #include <linux/maple_tree.h>
 #include <linux/irqdomain.h>
 #include <linux/sysfs.h>
+#include <linux/string_choices.h>
 
 #include "internals.h"
 
@@ -320,8 +321,7 @@ static ssize_t wakeup_show(struct kobject *kobj,
 	ssize_t ret = 0;
 
 	raw_spin_lock_irq(&desc->lock);
-	ret = sprintf(buf, "%s\n",
-		      irqd_is_wakeup_set(&desc->irq_data) ? "enabled" : "disabled");
+	ret = sprintf(buf, "%s\n", str_enabled_disabled(irqd_is_wakeup_set(&desc->irq_data)));
 	raw_spin_unlock_irq(&desc->lock);
 
 	return ret;