* [PATCH] fpga: bridge: Use str_enabled_disabled helper in state_show
@ 2025-11-23 18:22 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2025-11-23 18:22 UTC (permalink / raw)
To: Moritz Fischer, Xu Yilun, Tom Rix; +Cc: Thorsten Blum, linux-fpga, linux-kernel
Replace hard-coded strings with the str_enabled_disabled() helper. This
unifies the output and helps the linker with deduplication, which can
result in a smaller binary.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/fpga/fpga-bridge.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index 8ef395b49bf8..0c54e415fa5a 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -12,6 +12,7 @@
#include <linux/of_platform.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/string_choices.h>
static DEFINE_IDA(fpga_bridge_ida);
static const struct class fpga_bridge_class;
@@ -305,7 +306,7 @@ static ssize_t state_show(struct device *dev,
return state;
}
- return sysfs_emit(buf, "%s\n", state ? "enabled" : "disabled");
+ return sysfs_emit(buf, "%s\n", str_enabled_disabled(state));
}
static DEVICE_ATTR_RO(name);
--
2.51.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-23 18:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 18:22 [PATCH] fpga: bridge: Use str_enabled_disabled helper in state_show Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).