diff options
author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2021-12-02 06:52:57 +0100 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-01-04 12:00:12 +0100 |
commit | 58c541146b6601ad0b12f2a1f8fc925a3a3e0006 (patch) | |
tree | ef19074bec006d620f7751407cf5bc2872e7b363 /drivers/ata | |
parent | ata: sata_fsl: Use struct_group() for memcpy() region (diff) | |
download | linux-58c541146b6601ad0b12f2a1f8fc925a3a3e0006.tar.xz linux-58c541146b6601ad0b12f2a1f8fc925a3a3e0006.zip |
ata: libata-sata: use sysfs_emit()
Use sysfs_emit() instead of snprintf() in sysfs attibute show()
functions.
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-sata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index b9c77885b872..eddd33a3cb5f 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -876,7 +876,7 @@ static ssize_t ata_ncq_prio_enable_show(struct device *device, ncq_prio_enable = dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLE; spin_unlock_irq(ap->lock); - return rc ? rc : snprintf(buf, 20, "%u\n", ncq_prio_enable); + return rc ? rc : sysfs_emit(buf, "%u\n", ncq_prio_enable); } static ssize_t ata_ncq_prio_enable_store(struct device *device, @@ -972,7 +972,7 @@ ata_scsi_em_message_type_show(struct device *dev, struct device_attribute *attr, struct Scsi_Host *shost = class_to_shost(dev); struct ata_port *ap = ata_shost_to_port(shost); - return snprintf(buf, 23, "%d\n", ap->em_message_type); + return sysfs_emit(buf, "%d\n", ap->em_message_type); } DEVICE_ATTR(em_message_type, S_IRUGO, ata_scsi_em_message_type_show, NULL); |