From: Jonathan Cameron <jic23@kernel.org>
To: <ye.xingchen@zte.com.cn>
Cc: <eugen.hristev@microchip.com>, <lars@metafoo.de>,
<nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
<claudiu.beznea@microchip.com>, <linux-iio@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: adc: at91-sama5d2_adc: use sysfs_emit() to instead of scnprintf()
Date: Sun, 4 Dec 2022 15:46:21 +0000 [thread overview]
Message-ID: <20221204154621.3b76d888@jic23-huawei> (raw)
In-Reply-To: <202212011142333790361@zte.com.cn>
On Thu, 1 Dec 2022 11:42:33 +0800 (CST)
<ye.xingchen@zte.com.cn> wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Replace the open-code with sysfs_emit() to simplify the code.
>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Applied.
Thanks,
Jonathan
> ---
> drivers/iio/adc/at91-sama5d2_adc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> index ed4f8501bda8..50d02e5fc6fc 100644
> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> @@ -2181,7 +2181,7 @@ static ssize_t at91_adc_get_fifo_state(struct device *dev,
> struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> struct at91_adc_state *st = iio_priv(indio_dev);
>
> - return scnprintf(buf, PAGE_SIZE, "%d\n", !!st->dma_st.dma_chan);
> + return sysfs_emit(buf, "%d\n", !!st->dma_st.dma_chan);
> }
>
> static ssize_t at91_adc_get_watermark(struct device *dev,
> @@ -2190,7 +2190,7 @@ static ssize_t at91_adc_get_watermark(struct device *dev,
> struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> struct at91_adc_state *st = iio_priv(indio_dev);
>
> - return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark);
> + return sysfs_emit(buf, "%d\n", st->dma_st.watermark);
> }
>
> static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
prev parent reply other threads:[~2022-12-04 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 3:42 [PATCH] iio: adc: at91-sama5d2_adc: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-04 15:46 ` Jonathan Cameron [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=20221204154621.3b76d888@jic23-huawei \
--to=jic23@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=eugen.hristev@microchip.com \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=ye.xingchen@zte.com.cn \
/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