* [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit
@ 2022-08-31 12:55 Xuezhi Zhang
2022-08-31 12:58 ` Ian Abbott
2022-08-31 14:02 ` Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: Xuezhi Zhang @ 2022-08-31 12:55 UTC (permalink / raw)
To: abbotti, hsweeten, gregkh, zhangxuezhi1; +Cc: linux-kernel
From: zhangxuezhi1 <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.
---
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,
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit
2022-08-31 12:55 [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
@ 2022-08-31 12:58 ` Ian Abbott
2022-08-31 14:02 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: Ian Abbott @ 2022-08-31 12:58 UTC (permalink / raw)
To: Xuezhi Zhang, hsweeten, gregkh, zhangxuezhi1; +Cc: linux-kernel
On 31/08/2022 13:55, Xuezhi Zhang wrote:
> From: zhangxuezhi1 <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.
> ---
> 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 )=-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit
2022-08-31 12:55 [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
2022-08-31 12:58 ` Ian Abbott
@ 2022-08-31 14:02 ` Greg KH
2022-09-01 1:05 ` zhangxuezhi3
1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2022-08-31 14:02 UTC (permalink / raw)
To: Xuezhi Zhang; +Cc: abbotti, hsweeten, zhangxuezhi1, linux-kernel
On Wed, Aug 31, 2022 at 08:55:20PM +0800, Xuezhi Zhang wrote:
> From: zhangxuezhi1 <zhangxuezhi1@coolpad.com>
>
> Fix up all sysfs show entries to use sysfs_emit
This says "what", but not "why".
Please read the kernel documentation for how to write a good changelog
text.
>
> Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
> ---
> v2: use a proper name for the Signed-off-by line.
Does not match the From: line :(
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit
2022-08-31 14:02 ` Greg KH
@ 2022-09-01 1:05 ` zhangxuezhi3
0 siblings, 0 replies; 4+ messages in thread
From: zhangxuezhi3 @ 2022-09-01 1:05 UTC (permalink / raw)
To: Greg KH; +Cc: abbotti, hsweeten, zhangxuezhi1, linux-kernel
On Wed, 31 Aug 2022 16:02:11 +0200
Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Aug 31, 2022 at 08:55:20PM +0800, Xuezhi Zhang wrote:
> > From: zhangxuezhi1 <zhangxuezhi1@coolpad.com>
> >
> > Fix up all sysfs show entries to use sysfs_emit
>
> This says "what", but not "why".
>
> Please read the kernel documentation for how to write a good changelog
> text.
>
> >
> > Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
> > ---
> > v2: use a proper name for the Signed-off-by line.
>
> Does not match the From: line :(
>
>
> thanks,
>
> greg k-h
OK, I see.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-01 1:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 12:55 [PATCH v2] comedi: sysfs: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
2022-08-31 12:58 ` Ian Abbott
2022-08-31 14:02 ` Greg KH
2022-09-01 1:05 ` zhangxuezhi3
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.