All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tian Tao <tiantao6@hisilicon.com>
To: <jic23@kernel.org>, <tduszyns@gmail.com>,
	<mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>
Cc: <linux-iio@vger.kernel.org>, Tian Tao <tiantao6@hisilicon.com>
Subject: [PATCH drivers/iio 3/3] iio: trigger: stm32-timer: Convert sysfs sprintf/snprintf family to sysfs_emit
Date: Mon, 12 Apr 2021 16:39:11 +0800	[thread overview]
Message-ID: <1618216751-1678-4-git-send-email-tiantao6@hisilicon.com> (raw)
In-Reply-To: <1618216751-1678-1-git-send-email-tiantao6@hisilicon.com>

Fix the following coccicheck warning:
drivers/iio/trigger/stm32-timer-trigger.c:299:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/iio/trigger/stm32-timer-trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
index 3aa9e8b..3308387 100644
--- a/drivers/iio/trigger/stm32-timer-trigger.c
+++ b/drivers/iio/trigger/stm32-timer-trigger.c
@@ -296,7 +296,7 @@ static ssize_t stm32_tt_show_master_mode(struct device *dev,
 	else
 		cr2 = (cr2 & TIM_CR2_MMS) >> TIM_CR2_MMS_SHIFT;
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", master_mode_table[cr2]);
+	return sysfs_emit(buf, "%s\n", master_mode_table[cr2]);
 }
 
 static ssize_t stm32_tt_store_master_mode(struct device *dev,
-- 
2.7.4


  parent reply	other threads:[~2021-04-12  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12  8:39 [PATCH drivers/iio 0/3] convert sysfs sprintf/snprintf/scnprintf to sysfs_emit Tian Tao
2021-04-12  8:39 ` [PATCH drivers/iio 1/3] iio:chemical:sps30: Convert sysfs sprintf/snprintf family " Tian Tao
2021-04-12  8:39 ` [PATCH drivers/iio 2/3] iio: light: " Tian Tao
2021-04-12  8:39 ` Tian Tao [this message]
2021-04-18 10:06 ` [PATCH drivers/iio 0/3] convert sysfs sprintf/snprintf/scnprintf " Jonathan Cameron

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=1618216751-1678-4-git-send-email-tiantao6@hisilicon.com \
    --to=tiantao6@hisilicon.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=tduszyns@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.