Re: [PATCH RESEND] fpga: bridge: Use str_enabled_disabled helper in state_show

From: Dinh Nguyen

Date: Sun Mar 01 2026 - 08:07:08 EST


Hi Thorsten,

On 2/24/26 10:15, Thorsten Blum wrote:
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@xxxxxxxxx>
---
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 ca68c38aa4a1..e8ff3e3bf2fc 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);

Would you consider including this patch[1] to this?

Dinh
[1] https://lore.kernel.org/linux-fpga/aXH2D06eZ5DRTVi0@yilunxu-OptiPlex-7050/