mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] docs/zh_CN: update sysfs.txt about show() usage
@ 2020-06-10  2:53 Chen Zhou
  2020-06-10  5:24 ` Alex Shi
  2020-06-19 19:30 ` Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Zhou @ 2020-06-10  2:53 UTC (permalink / raw)
  To: harryxiyou, alex.shi, corbet
  Cc: mchehab+huawei, chenzhou10, linux-doc, linux-kernel

Update the show() usage according to the English version.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
 Documentation/translations/zh_CN/filesystems/sysfs.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index fcf620049d11..9481e3ed2a06 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -213,10 +213,12 @@ Sysfs 将会为每次读写操作调用一次这个方法。这使得这些方
 
 - 缓冲区应总是 PAGE_SIZE 大小。对于i386,这个值为4096。
 
-- show() 方法应该返回写入缓冲区的字节数,也就是 snprintf()的
+- show() 方法应该返回写入缓冲区的字节数,也就是 scnprintf()的
   返回值。
 
-- show() 应始终使用 snprintf()。
+- show() 方法在将格式化返回值返回用户空间的时候,禁止使用snprintf()。
+  如果可以保证不会发生缓冲区溢出,可以使用sprintf(),否则必须使用
+  scnprintf()。
 
 - store() 应返回缓冲区的已用字节数。如果整个缓存都已填满,只需返回
   count 参数。
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/zh_CN: update sysfs.txt about show() usage
  2020-06-10  2:53 [PATCH] docs/zh_CN: update sysfs.txt about show() usage Chen Zhou
@ 2020-06-10  5:24 ` Alex Shi
  2020-06-19 19:30 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Shi @ 2020-06-10  5:24 UTC (permalink / raw)
  To: Chen Zhou, harryxiyou, corbet; +Cc: mchehab+huawei, linux-doc, linux-kernel

Reviewed-by: Alex Shi <alex.shi@linux.alibaba.com>

Thanks
Alex

在 2020/6/10 上午10:53, Chen Zhou 写道:
> Update the show() usage according to the English version.
> 
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
> ---
>  Documentation/translations/zh_CN/filesystems/sysfs.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
> index fcf620049d11..9481e3ed2a06 100644
> --- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
> +++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
> @@ -213,10 +213,12 @@ Sysfs 将会为每次读写操作调用一次这个方法。这使得这些方
>  
>  - 缓冲区应总是 PAGE_SIZE 大小。对于i386,这个值为4096。
>  
> -- show() 方法应该返回写入缓冲区的字节数,也就是 snprintf()的
> +- show() 方法应该返回写入缓冲区的字节数,也就是 scnprintf()的
>    返回值。
>  
> -- show() 应始终使用 snprintf()。
> +- show() 方法在将格式化返回值返回用户空间的时候,禁止使用snprintf()。
> +  如果可以保证不会发生缓冲区溢出,可以使用sprintf(),否则必须使用
> +  scnprintf()。
>  
>  - store() 应返回缓冲区的已用字节数。如果整个缓存都已填满,只需返回
>    count 参数。
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docs/zh_CN: update sysfs.txt about show() usage
  2020-06-10  2:53 [PATCH] docs/zh_CN: update sysfs.txt about show() usage Chen Zhou
  2020-06-10  5:24 ` Alex Shi
@ 2020-06-19 19:30 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2020-06-19 19:30 UTC (permalink / raw)
  To: Chen Zhou; +Cc: harryxiyou, alex.shi, mchehab+huawei, linux-doc, linux-kernel

On Wed, 10 Jun 2020 10:53:33 +0800
Chen Zhou <chenzhou10@huawei.com> wrote:

> Update the show() usage according to the English version.
> 
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
> ---
>  Documentation/translations/zh_CN/filesystems/sysfs.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-19 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  2:53 [PATCH] docs/zh_CN: update sysfs.txt about show() usage Chen Zhou
2020-06-10  5:24 ` Alex Shi
2020-06-19 19:30 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®