lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3] comedi: convert sysfs snprintf to sysfs_emit
From
On 31/08/2022 14:09, Xuezhi Zhang wrote:
> From: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
>
> Fix up all sysfs show entries to use sysfs_emit
>
> Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
> ---
> v2: use a proper name for the Signed-off-by line.
> v3: fix From line and Subject line.
> ---
> drivers/comedi/comedi_fops.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/comedi/comedi_fops.c b/drivers/comedi/comedi_fops.c
> index 55a0cae04b8d..e2114bcf815a 100644
> --- a/drivers/comedi/comedi_fops.c
> +++ b/drivers/comedi/comedi_fops.c
> @@ -396,7 +396,7 @@ static ssize_t max_read_buffer_kb_show(struct device *csdev,
> mutex_unlock(&dev->mutex);
>
> comedi_dev_put(dev);
> - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> + return sysfs_emit(buf, "%u\n", size);
> }
>
> static ssize_t max_read_buffer_kb_store(struct device *csdev,
> @@ -452,7 +452,7 @@ static ssize_t read_buffer_kb_show(struct device *csdev,
> mutex_unlock(&dev->mutex);
>
> comedi_dev_put(dev);
> - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> + return sysfs_emit(buf, "%u\n", size);
> }
>
> static ssize_t read_buffer_kb_store(struct device *csdev,
> @@ -509,7 +509,7 @@ static ssize_t max_write_buffer_kb_show(struct device *csdev,
> mutex_unlock(&dev->mutex);
>
> comedi_dev_put(dev);
> - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> + return sysfs_emit(buf, "%u\n", size);
> }
>
> static ssize_t max_write_buffer_kb_store(struct device *csdev,
> @@ -565,7 +565,7 @@ static ssize_t write_buffer_kb_show(struct device *csdev,
> mutex_unlock(&dev->mutex);
>
> comedi_dev_put(dev);
> - return snprintf(buf, PAGE_SIZE, "%u\n", size);
> + return sysfs_emit(buf, "%u\n", size);
> }
>
> static ssize_t write_buffer_kb_store(struct device *csdev,

Looks good, thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-

\
 
 \ /
  Last update: 2022-08-31 15:25    [W:0.030 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site