mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 20:13:02 +02:00
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
This commit is contained in:
parent
749c510248
commit
07897bdf7a
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user