mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()
@ 2024-10-26 15:40 Thorsten Blum
  2024-10-27  9:53 ` [tip: irq/core] " tip-bot2 for Thorsten Blum
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-10-26 15:40 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Thorsten Blum, linux-kernel

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 kernel/irq/irqdesc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 1dee88ba0ae4..a135b2ce886f 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -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;
-- 
2.47.0


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

* [tip: irq/core] genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()
  2024-10-26 15:40 [PATCH] genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show() Thorsten Blum
@ 2024-10-27  9:53 ` tip-bot2 for Thorsten Blum
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Thorsten Blum @ 2024-10-27  9:53 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Thorsten Blum, Thomas Gleixner, x86, linux-kernel, maz

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 <thorsten.blum@linux.dev>
AuthorDate:    Sat, 26 Oct 2024 17:40:29 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241026154029.158977-2-thorsten.blum@linux.dev

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

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 479cf1c..0253e77 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -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;

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

end of thread, other threads:[~2024-10-27  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-26 15:40 [PATCH] genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show() Thorsten Blum
2024-10-27  9:53 ` [tip: irq/core] " tip-bot2 for Thorsten Blum

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

Powered by JetHome