ata: replace snprintf in show functions with sysfs_emit
PATCH 1/1 ata: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions.
Fix the following coccicheck warning:
drivers/ata/libata-sata.c:830:8-16: WARNING: use scnprintf or sprintf.
Use sysfs_emit instead of scnprintf or sprintf makes more sense.
Signed-off-by Qing Wang <[email protected]>
--- drivers/ata/libata-sata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-sata.c +1 -1
@@ -827,7 +827,7 @@ static ssize_t ata_scsi_lpm_show(struct device *dev,if (ap->target_lpm_policy >=ARRAY_SIZE (ata_lpm_policy_names))return -EINVAL ; -return snprintf (buf,PAGE_SIZE ,"%s\n" , +return sysfs_emit (buf,"%s\n" , ata_lpm_policy_names[ap->target_lpm_policy]); } DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
Signature · 1 line
2.7.4