lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221204154906.163c9c02@jic23-huawei>
Date:   Sun, 4 Dec 2022 15:49:06 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     <ye.xingchen@....com.cn>
Cc:     <jbhayana@...gle.com>, <lars@...afoo.de>,
        <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Sudeep Holla <sudeep.holla@....com>,
        Cristian Marussi <cristian.marussi@....com>
Subject: Re: [PATCH] iio: common: scmi_iio: use sysfs_emit() to instead of 
  scnprintf()

On Thu, 1 Dec 2022 11:56:31 +0800 (CST)
<ye.xingchen@....com.cn> wrote:

> From: ye xingchen <ye.xingchen@....com.cn>
> 
> Replace the open-code with sysfs_emit() to simplify the code.
> 
> Signed-off-by: ye xingchen <ye.xingchen@....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);
>  		}
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ