Skip to contentSkip to conversation

fpga: bridge: Use str_enabled_disabled helper in state_show

PATCH RESEND Superseded Thorsten Blum 1 participant 1 message Dec 19, 2025 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 fpga: bridge: Use str_enabled_disabled helper in state_show

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.

---
 drivers/fpga/fpga-bridge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/fpga-bridge.c +2 -1
index 8ef395b49bf8..0c54e415fa5a 100644
@@ -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);
Signature · 2 lines
Thorsten Blum <[email protected]>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4