mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08:00
firmware: stratix10-rsu: replace scnprintf() with sysfs_emit() in *_show() functions
Replace scnprintf() with sysfs_emit() in sysfs *_show() functions in stratix10-rsu.c to follow the kernel's guidelines from Documentation/filesystems/sysfs.rst. This improves consistency, safety, and makes the code easier to maintain and update in the future. Signed-off-by: Rahul Kumar <rk0006818@gmail.com> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
This commit is contained in:
@@ -478,8 +478,7 @@ static ssize_t max_retry_show(struct device *dev,
|
||||
if (!priv)
|
||||
return -ENODEV;
|
||||
|
||||
return scnprintf(buf, sizeof(priv->max_retry),
|
||||
"0x%08x\n", priv->max_retry);
|
||||
return sysfs_emit(buf, "0x%08x\n", priv->max_retry);
|
||||
}
|
||||
|
||||
static ssize_t dcmf0_show(struct device *dev,
|
||||
@@ -649,7 +648,7 @@ static ssize_t spt0_address_show(struct device *dev,
|
||||
if (priv->spt0_address == INVALID_SPT_ADDRESS)
|
||||
return -EIO;
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "0x%08lx\n", priv->spt0_address);
|
||||
return sysfs_emit(buf, "0x%08lx\n", priv->spt0_address);
|
||||
}
|
||||
|
||||
static ssize_t spt1_address_show(struct device *dev,
|
||||
@@ -663,7 +662,7 @@ static ssize_t spt1_address_show(struct device *dev,
|
||||
if (priv->spt1_address == INVALID_SPT_ADDRESS)
|
||||
return -EIO;
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "0x%08lx\n", priv->spt1_address);
|
||||
return sysfs_emit(buf, "0x%08lx\n", priv->spt1_address);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RO(current_image);
|
||||
|
||||
Reference in New Issue
Block a user