diff options
| author | Abhinav Ananthu <abhinav.ogl@gmail.com> | 2025-06-20 01:51:34 +0530 |
|---|---|---|
| committer | Borislav Petkov (AMD) <bp@alien8.de> | 2026-06-30 12:39:17 -0700 |
| commit | 07897bdf7a9c60455a175f6eb619c7d95e1d1765 (patch) | |
| tree | 65b8282ecf92dae637ce7cd61a49fe7e1e5e1007 | |
| parent | 749c5102487b558cc7d73961a6d0da2fceaa022d (diff) | |
| download | linux-07897bdf7a9c60455a175f6eb619c7d95e1d1765.tar.gz linux-07897bdf7a9c60455a175f6eb619c7d95e1d1765.zip | |
EDAC/sysfs: Use sysfs_emit_at() in dimmdev_location_show()
Replace the use of scnprintf() with sysfs_emit_at() in dimmdev_location_show()
to format the output into the sysfs buffer and thus improve clarity and ensure
proper bounds checking in line with the preferred sysfs_emit() API usage for
sysfs 'show' functions.
No functional change intended.
[ bp: Massage commit message. ]
Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Link: https://patch.msgid.link/20250619202133.11843-1-abhinav.ogl@gmail.com
| -rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index c2ed6c696e54..9b4b5582fa9f 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -129,7 +129,7 @@ static ssize_t dimmdev_location_show(struct device *dev, ssize_t count; count = edac_dimm_info_location(dimm, data, PAGE_SIZE); - count += scnprintf(data + count, PAGE_SIZE - count, "\n"); + count += sysfs_emit_at(data, count, "\n"); return count; } |
