linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: linux-ide@vger.kernel.org
Subject: [PATCH 4/4] ata: sata_fsl: use sysfs_emit()
Date: Thu,  2 Dec 2021 17:37:43 +0900	[thread overview]
Message-ID: <20211202083743.645391-6-damien.lemoal@opensource.wdc.com> (raw)
In-Reply-To: <20211202083743.645391-1-damien.lemoal@opensource.wdc.com>

Use sysfs_emit() instead of sprintf() in fsl_sata_intr_coalescing_show()
and fsl_sata_rx_watermark_show().

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 drivers/ata/sata_fsl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index c5a2c1e9ed6b..ec52511ae60f 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -322,7 +322,7 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host,
 static ssize_t fsl_sata_intr_coalescing_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
-	return sprintf(buf, "%d	%d\n",
+	return sysfs_emit(buf, "%d	%d\n",
 			intr_coalescing_count, intr_coalescing_ticks);
 }
 
@@ -357,9 +357,9 @@ static ssize_t fsl_sata_rx_watermark_show(struct device *dev,
 	spin_lock_irqsave(&host->lock, flags);
 	rx_watermark = ioread32(csr_base + TRANSCFG);
 	rx_watermark &= 0x1f;
-
 	spin_unlock_irqrestore(&host->lock, flags);
-	return sprintf(buf, "%d\n", rx_watermark);
+
+	return sysfs_emit(buf, "%d\n", rx_watermark);
 }
 
 static ssize_t fsl_sata_rx_watermark_store(struct device *dev,
-- 
2.31.1


      parent reply	other threads:[~2021-12-02  8:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  8:37 [PATCH 0/4] Cleanup ATA sysfs attribute show functions Damien Le Moal
2021-12-02  8:37 ` [PATCH] ata: ahci_ceva: Fix sparse warning in ceva_ahci_read_id() Damien Le Moal
2021-12-02  8:37 ` [PATCH 1/4] ata: libata-sata: use sysfs_emit() Damien Le Moal
2021-12-02  8:37 ` [PATCH 2/4] ata: libata-scsi: " Damien Le Moal
2021-12-02  8:37 ` [PATCH 3/4] ata: ahci: " Damien Le Moal
2021-12-02  8:37 ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211202083743.645391-6-damien.lemoal@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).