[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250625120601.18445-1-seokwoo.chung130@gmail.com>
Date: Wed, 25 Jun 2025 21:05:49 +0900
From: Ryan Chung <seokwoo.chung130@...il.com>
To: hao.wu@...el.com,
trix@...hat.com,
mdf@...nel.org,
yilun.xu@...el.com
Cc: Ryan Chung <seokwoo.chung130@...il.com>,
linux-fpga@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linux.dev
Subject: [PATCH] dfl-fme-main.c: Replace scnprintf() with sysfs_emit()
This change uses sysfs_emit() API usage for sysfs 'show'
functions as recommended from Documentation/filesystems/sysfs.rst.
No functional change intended.
Signed-off-by: Ryan Chung <seokwoo.chung130@...il.com>
---
drivers/fpga/dfl-fme-main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme-main.c
index 8aca2fb20e87..4be51ae60226 100644
--- a/drivers/fpga/dfl-fme-main.c
+++ b/drivers/fpga/dfl-fme-main.c
@@ -36,7 +36,7 @@ static ssize_t ports_num_show(struct device *dev,
v = readq(base + FME_HDR_CAP);
- return scnprintf(buf, PAGE_SIZE, "%u\n",
+ return sysfs_emit(buf, "%u\n",
(unsigned int)FIELD_GET(FME_CAP_NUM_PORTS, v));
}
static DEVICE_ATTR_RO(ports_num);
@@ -56,7 +56,7 @@ static ssize_t bitstream_id_show(struct device *dev,
v = readq(base + FME_HDR_BITSTREAM_ID);
- return scnprintf(buf, PAGE_SIZE, "0x%llx\n", (unsigned long long)v);
+ return sysfs_emit(buf, "0x%llx\n", (unsigned long long)v);
}
static DEVICE_ATTR_RO(bitstream_id);
@@ -75,7 +75,7 @@ static ssize_t bitstream_metadata_show(struct device *dev,
v = readq(base + FME_HDR_BITSTREAM_MD);
- return scnprintf(buf, PAGE_SIZE, "0x%llx\n", (unsigned long long)v);
+ return sysfs_emit(buf, "0x%llx\n", (unsigned long long)v);
}
static DEVICE_ATTR_RO(bitstream_metadata);
--
2.43.0
Powered by blists - more mailing lists