Re: [PATCH] fpga: dfl: Replace scnprintf() with sysfs_emit()
From: Greg KH
Date: Mon Jun 30 2025 - 09:22:03 EST
On Mon, Jun 30, 2025 at 09:50:18PM +0900, Ryan Chung wrote:
> Signed-off-by: Ryan Chung <seokwoo.chung130@xxxxxxxxx>
I know I can't take patches without any changelog text, but maybe other
maintainers are more lax?
Also, you only said what you did, but not why you did it.
> ---
> drivers/fpga/dfl-afu-main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c
> index 3bf8e7338dbe..f2dd4667a43d 100644
> --- a/drivers/fpga/dfl-afu-main.c
> +++ b/drivers/fpga/dfl-afu-main.c
> @@ -156,7 +156,7 @@ id_show(struct device *dev, struct device_attribute *attr, char *buf)
> struct dfl_feature_dev_data *fdata = to_dfl_feature_dev_data(dev);
> int id = port_get_id(fdata);
>
> - return scnprintf(buf, PAGE_SIZE, "%d\n", id);
> + return sysfs_emit(buf, PAGE_SIZE, "%d\n", id);
Did you build this? Did you test it?
> }
> static DEVICE_ATTR_RO(id);
>
> @@ -475,7 +475,7 @@ afu_id_show(struct device *dev, struct device_attribute *attr, char *buf)
> guidh = readq(base + GUID_H);
> mutex_unlock(&fdata->lock);
>
> - return scnprintf(buf, PAGE_SIZE, "%016llx%016llx\n", guidh, guidl);
> + return sysfs_emit(buf, PAGE_SIZE, "%016llx%016llx\n", guidh, guidl);
Same here, was this built?
And what's wrong with the original code?
thanks,
greg k-h