From: Thorsten Blum <thorsten.blum@linux.dev>
To: Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
Tom Rix <trix@redhat.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] fpga: bridge: Use str_enabled_disabled helper in state_show
Date: Tue, 24 Feb 2026 17:15:03 +0100 [thread overview]
Message-ID: <20260224161504.587562-1-thorsten.blum@linux.dev> (raw)
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 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);
--
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
next reply other threads:[~2026-02-24 16:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 16:15 Thorsten Blum [this message]
2026-03-01 13:06 ` [PATCH RESEND] fpga: bridge: Use str_enabled_disabled helper in state_show Dinh Nguyen
2026-03-02 3:34 ` Xu Yilun
-- strict thread matches above, loose matches on Subject: below --
2026-01-26 0:47 Thorsten Blum
2025-12-19 21:27 Thorsten Blum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260224161504.587562-1-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox