Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: <ye.xingchen@zte.com.cn>
Cc: <jbhayana@google.com>, <lars@metafoo.de>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Cristian Marussi <cristian.marussi@arm.com>
Subject: Re: [PATCH] iio: common: scmi_iio: use sysfs_emit() to instead of  scnprintf()
Date: Sun, 4 Dec 2022 15:49:06 +0000	[thread overview]
Message-ID: <20221204154906.163c9c02@jic23-huawei> (raw)
In-Reply-To: <202212011156314630626@zte.com.cn>

On Thu, 1 Dec 2022 11:56:31 +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. Cc'd scmi people as well just in case they are interested.


> ---
>  drivers/iio/common/scmi_sensors/scmi_iio.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/common/scmi_sensors/scmi_iio.c b/drivers/iio/common/scmi_sensors/scmi_iio.c
> index d92f7f651f7b..0c2caf3570db 100644
> --- a/drivers/iio/common/scmi_sensors/scmi_iio.c
> +++ b/drivers/iio/common/scmi_sensors/scmi_iio.c
> @@ -400,12 +400,12 @@ static ssize_t scmi_iio_get_raw_available(struct iio_dev *iio_dev,
>  			rem = do_div(resolution,
>  				     int_pow(10, abs(exponent))
>  				     );
> -			len = scnprintf(buf, PAGE_SIZE,
> +			len = sysfs_emit(buf,
>  					"[%lld %llu.%llu %lld]\n", min_range,
>  					resolution, rem, max_range);
>  		} else {
>  			resolution = resolution * int_pow(10, exponent);
> -			len = scnprintf(buf, PAGE_SIZE, "[%lld %llu %lld]\n",
> +			len = sysfs_emit(buf, "[%lld %llu %lld]\n",
>  					min_range, resolution, max_range);
>  		}
>  	}


  reply	other threads:[~2022-12-04 15:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  3:56 [PATCH] iio: common: scmi_iio: use sysfs_emit() to instead of scnprintf() ye.xingchen
2022-12-04 15:49 ` Jonathan Cameron [this message]
2022-12-05 10:39   ` Sudeep Holla

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=20221204154906.163c9c02@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=jbhayana@google.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@arm.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