Skip to content

Commit 06d5d55

Browse files
Yang GuangDamien Le Moal
authored andcommitted
ata: replace snprintf in show functions with sysfs_emit
coccinelle report: ./drivers/ata/libata-sata.c:830:8-16: WARNING: use scnprintf or sprintf Use sysfs_emit instead of scnprintf or sprintf makes more sense. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Yang Guang <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent 6f48394 commit 06d5d55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/libata-sata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ static ssize_t ata_scsi_lpm_show(struct device *dev,
827827
if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names))
828828
return -EINVAL;
829829

830-
return snprintf(buf, PAGE_SIZE, "%s\n",
830+
return sysfs_emit(buf, "%s\n",
831831
ata_lpm_policy_names[ap->target_lpm_policy]);
832832
}
833833
DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,

0 commit comments

Comments
 (0)