mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
accel/qaic: Replace snprintf() with sysfs_emit() in sysfs show functions
Documentation/filesystems/sysfs.rst mentions that show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. So replace snprintf() with sysfs_emit(). Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> [jhugo: Fix commit text typos] Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250822112804.1726592-1-chelsyratnawat2001@gmail.com
This commit is contained in:
committed by
Jeff Hugo
parent
bed1291240
commit
e68c994445
@@ -514,21 +514,21 @@ static ssize_t ce_count_show(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
struct qaic_device *qdev = pci_get_drvdata(to_pci_dev(dev));
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", qdev->ce_count);
|
||||
return sysfs_emit(buf, "%d\n", qdev->ce_count);
|
||||
}
|
||||
|
||||
static ssize_t ue_count_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct qaic_device *qdev = pci_get_drvdata(to_pci_dev(dev));
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", qdev->ue_count);
|
||||
return sysfs_emit(buf, "%d\n", qdev->ue_count);
|
||||
}
|
||||
|
||||
static ssize_t ue_nonfatal_count_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct qaic_device *qdev = pci_get_drvdata(to_pci_dev(dev));
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", qdev->ue_nf_count);
|
||||
return sysfs_emit(buf, "%d\n", qdev->ue_nf_count);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RO(ce_count);
|
||||
|
||||
Reference in New Issue
Block a user