All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] docs/zh_CN: move and update sparse
@ 2021-11-03  2:46 Yanteng Si
  2021-11-03  2:46 ` [PATCH v2 1/2] docs/zh_CN: move sparse into dev-tools Yanteng Si
  2021-11-03  2:46 ` [PATCH v2 2/2] docs/zh_CN: update sparse translation Yanteng Si
  0 siblings, 2 replies; 5+ messages in thread
From: Yanteng Si @ 2021-11-03  2:46 UTC (permalink / raw)
  To: corbet, alexs, bobwxc, seakeel, leoyang.li
  Cc: Yanteng Si, chenhuacai, jiaxun.yang, linux-doc, realpuyuwang,
	siyanteng01, src.res, wanjiabing, bernard

v2:

At the suggestion of Leo Li:

* typo fix.
* recovert `` `` to “ ”.

v1:

The Chinese sparse documentation is too old, so let's update it to
the latest version and move it to ../zh_CN/dev-tools/.

Yanteng Si (2):
  docs/zh_CN: move sparse into dev-tools
  docs/zh_CN: update sparse translation

 .../translations/zh_CN/dev-tools/index.rst    |  2 +-
 .../{sparse.txt => dev-tools/sparse.rst}      | 63 ++++++++++++-------
 2 files changed, 41 insertions(+), 24 deletions(-)
 rename Documentation/translations/zh_CN/{sparse.txt => dev-tools/sparse.rst} (59%)

-- 
2.27.0


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

* [PATCH v2 1/2] docs/zh_CN: move sparse into dev-tools
  2021-11-03  2:46 [PATCH v2 0/2] docs/zh_CN: move and update sparse Yanteng Si
@ 2021-11-03  2:46 ` Yanteng Si
  2021-11-04 11:39   ` Alex Shi
  2021-11-03  2:46 ` [PATCH v2 2/2] docs/zh_CN: update sparse translation Yanteng Si
  1 sibling, 1 reply; 5+ messages in thread
From: Yanteng Si @ 2021-11-03  2:46 UTC (permalink / raw)
  To: corbet, alexs, bobwxc, seakeel, leoyang.li
  Cc: Yanteng Si, chenhuacai, jiaxun.yang, linux-doc, realpuyuwang,
	src.res, wanjiabing, bernard, Yanteng Si

From: Yanteng Si <siyanteng01@gmail.com>

../zh_CN/saprse.txt is alone at here, let's move it to ../zh_CN/dev-tools/sparse.rst.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 Documentation/translations/zh_CN/dev-tools/index.rst            | 2 +-
 .../translations/zh_CN/{sparse.txt => dev-tools/sparse.rst}     | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename Documentation/translations/zh_CN/{sparse.txt => dev-tools/sparse.rst} (100%)

diff --git a/Documentation/translations/zh_CN/dev-tools/index.rst b/Documentation/translations/zh_CN/dev-tools/index.rst
index 0f770b8664e9..77a8c44cdf49 100644
--- a/Documentation/translations/zh_CN/dev-tools/index.rst
+++ b/Documentation/translations/zh_CN/dev-tools/index.rst
@@ -22,13 +22,13 @@ Documentation/translations/zh_CN/dev-tools/testing-overview.rst
    :maxdepth: 2
 
    testing-overview
+   sparse
    gcov
    kasan
 
 Todolist:
 
  - coccinelle
- - sparse
  - kcov
  - ubsan
  - kmemleak
diff --git a/Documentation/translations/zh_CN/sparse.txt b/Documentation/translations/zh_CN/dev-tools/sparse.rst
similarity index 100%
rename from Documentation/translations/zh_CN/sparse.txt
rename to Documentation/translations/zh_CN/dev-tools/sparse.rst
-- 
2.27.0


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

* [PATCH v2 2/2] docs/zh_CN: update sparse translation
  2021-11-03  2:46 [PATCH v2 0/2] docs/zh_CN: move and update sparse Yanteng Si
  2021-11-03  2:46 ` [PATCH v2 1/2] docs/zh_CN: move sparse into dev-tools Yanteng Si
@ 2021-11-03  2:46 ` Yanteng Si
  2021-11-04 11:38   ` Alex Shi
  1 sibling, 1 reply; 5+ messages in thread
From: Yanteng Si @ 2021-11-03  2:46 UTC (permalink / raw)
  To: corbet, alexs, bobwxc, seakeel, leoyang.li
  Cc: Yanteng Si, chenhuacai, jiaxun.yang, linux-doc, realpuyuwang,
	siyanteng01, src.res, wanjiabing, bernard

Sparse documents are too outdated,let's update sparse.rst to the latest version.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 .../translations/zh_CN/dev-tools/sparse.rst   | 63 ++++++++++++-------
 1 file changed, 40 insertions(+), 23 deletions(-)

diff --git a/Documentation/translations/zh_CN/dev-tools/sparse.rst b/Documentation/translations/zh_CN/dev-tools/sparse.rst
index 0f444b83d639..e2df999f2967 100644
--- a/Documentation/translations/zh_CN/dev-tools/sparse.rst
+++ b/Documentation/translations/zh_CN/dev-tools/sparse.rst
@@ -1,29 +1,29 @@
-Chinese translated version of Documentation/dev-tools/sparse.rst
+Copyright 2004 Linus Torvalds
+Copyright 2004 Pavel Machek <pavel@ucw.cz>
+Copyright 2006 Bob Copeland <me@bobcopeland.com>
 
-If you have any comment or update to the content, please contact the
-original document maintainer directly.  However, if you have a problem
-communicating in English you can also ask the Chinese maintainer for
-help.  Contact the Chinese maintainer if this translation is outdated
-or if there is a problem with the translation.
+.. include:: ../disclaimer-zh_CN.rst
 
-Chinese maintainer: Li Yang <leoyang.li@nxp.com>
----------------------------------------------------------------------
-Documentation/dev-tools/sparse.rst 的中文翻译
+:Original: Documentation/dev-tools/sparse.rst
 
-如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
-交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
-译存在问题,请联系中文版维护者。
+:翻译:
 
-中文版维护者: 李阳  Li Yang <leoyang.li@nxp.com>
-中文版翻译者: 李阳  Li Yang <leoyang.li@nxp.com>
+ Li Yang <leoyang.li@nxp.com>
 
+:校译:
 
-以下为正文
----------------------------------------------------------------------
+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
 
-Copyright 2004 Linus Torvalds
-Copyright 2004 Pavel Machek <pavel@ucw.cz>
-Copyright 2006 Bob Copeland <me@bobcopeland.com>
+.. _cn_sparse:
+
+Sparse
+======
+
+Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一些潜在问题。 关
+于sparse的概述,请参见https://lwn.net/Articles/689907/;本文档包含
+一些针对内核的sparse信息。
+关于sparse的更多信息,主要是关于它的内部结构,可以在它的官方网页上找到:
+https://sparse.docs.kernel.org 
 使用 sparse 工具做类型检查
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -60,25 +60,42 @@ __bitwise"类型。
 一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方式整数使用而
 不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确保不同位方
 式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),对他们来说
-常数"0"确实是特殊的。
+常数"0"确实 *是* 特殊的。
+
+使用sparse进行锁检查
+--------------------
+
+下面的宏对于 gcc 来说是未定义的,在 sparse 运行时定义,以使用sparse的“上下文”
+跟踪功能,应用于锁定。 这些注释告诉 sparse 什么时候有锁,以及注释的函数的进入和
+退出。
+
+__must_hold - 指定的锁在函数进入和退出时被持有。
+
+__acquires  - 指定的锁在函数退出时被持有,但在进入时不被持有。
+
+__releases  - 指定的锁在函数进入时被持有,但在退出时不被持有。
+
+如果函数在不持有锁的情况下进入和退出,在函数内部以平衡的方式获取和释放锁,则不
+需要注释。
+上面的三个注释是针对sparse否则会报告上下文不平衡的情况。
 
 获取 sparse 工具
 ~~~~~~~~~~~~~~~~
 
 你可以从 Sparse 的主页获取最新的发布版本:
 
-	http://www.kernel.org/pub/linux/kernel/people/josh/sparse/
+	https://www.kernel.org/pub/software/devel/sparse/dist/
 
 或者,你也可以使用 git 克隆最新的 sparse 开发版本:
 
-	git://git.kernel.org/pub/scm/linux/kernel/git/josh/sparse.git
+	git://git.kernel.org/pub/scm/devel/sparse/sparse.git
 
 一旦你下载了源码,只要以普通用户身份运行:
 
 	make
 	make install
 
-它将会被自动安装到你的 ~/bin 目录下。
+如果是标准的用户,它将会被自动安装到你的~/bin目录下。
 
 使用 sparse 工具
 ~~~~~~~~~~~~~~~~
-- 
2.27.0


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

* Re: [PATCH v2 2/2] docs/zh_CN: update sparse translation
  2021-11-03  2:46 ` [PATCH v2 2/2] docs/zh_CN: update sparse translation Yanteng Si
@ 2021-11-04 11:38   ` Alex Shi
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Shi @ 2021-11-04 11:38 UTC (permalink / raw)
  To: Yanteng Si
  Cc: Jonathan Corbet, Alex Shi, Wu X.C.,
	leoyang.li, Yanteng Si, Huacai Chen, Jiaxun Yang,
	Linux Doc Mailing List, Puyu Wang, Hu Haowen, Wan Jiabing,
	Bernard Zhao

On Wed, Nov 3, 2021 at 10:47 AM Yanteng Si <siyanteng01@gmail.com> wrote:
>
> Sparse documents are too outdated,let's update sparse.rst to the latest version.
>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>

looks fine for me.

Reviewed-by: Alex Shi <alexs@kernel.org>

> ---
>  .../translations/zh_CN/dev-tools/sparse.rst   | 63 ++++++++++++-------
>  1 file changed, 40 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/translations/zh_CN/dev-tools/sparse.rst b/Documentation/translations/zh_CN/dev-tools/sparse.rst
> index 0f444b83d639..e2df999f2967 100644
> --- a/Documentation/translations/zh_CN/dev-tools/sparse.rst
> +++ b/Documentation/translations/zh_CN/dev-tools/sparse.rst
> @@ -1,29 +1,29 @@
> -Chinese translated version of Documentation/dev-tools/sparse.rst
> +Copyright 2004 Linus Torvalds
> +Copyright 2004 Pavel Machek <pavel@ucw.cz>
> +Copyright 2006 Bob Copeland <me@bobcopeland.com>
>
> -If you have any comment or update to the content, please contact the
> -original document maintainer directly.  However, if you have a problem
> -communicating in English you can also ask the Chinese maintainer for
> -help.  Contact the Chinese maintainer if this translation is outdated
> -or if there is a problem with the translation.
> +.. include:: ../disclaimer-zh_CN.rst
>
> -Chinese maintainer: Li Yang <leoyang.li@nxp.com>
> ----------------------------------------------------------------------
> -Documentation/dev-tools/sparse.rst 的中文翻译
> +:Original: Documentation/dev-tools/sparse.rst
>
> -如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
> -交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
> -译存在问题,请联系中文版维护者。
> +:翻译:
>
> -中文版维护者: 李阳  Li Yang <leoyang.li@nxp.com>
> -中文版翻译者: 李阳  Li Yang <leoyang.li@nxp.com>
> + Li Yang <leoyang.li@nxp.com>
>
> +:校译:
>
> -以下为正文
> ----------------------------------------------------------------------
> + 司延腾 Yanteng Si <siyanteng@loongson.cn>
>
> -Copyright 2004 Linus Torvalds
> -Copyright 2004 Pavel Machek <pavel@ucw.cz>
> -Copyright 2006 Bob Copeland <me@bobcopeland.com>
> +.. _cn_sparse:
> +
> +Sparse
> +======
> +
> +Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一些潜在问题。 关
> +于sparse的概述,请参见https://lwn.net/Articles/689907/;本文档包含
> +一些针对内核的sparse信息。
> +关于sparse的更多信息,主要是关于它的内部结构,可以在它的官方网页上找到:
> +https://sparse.docs.kernel.org。
>
>  使用 sparse 工具做类型检查
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> @@ -60,25 +60,42 @@ __bitwise"类型。
>  一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方式整数使用而
>  不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确保不同位方
>  式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),对他们来说
> -常数"0"确实是特殊的。
> +常数"0"确实 *是* 特殊的。
> +
> +使用sparse进行锁检查
> +--------------------
> +
> +下面的宏对于 gcc 来说是未定义的,在 sparse 运行时定义,以使用sparse的“上下文”
> +跟踪功能,应用于锁定。 这些注释告诉 sparse 什么时候有锁,以及注释的函数的进入和
> +退出。
> +
> +__must_hold - 指定的锁在函数进入和退出时被持有。
> +
> +__acquires  - 指定的锁在函数退出时被持有,但在进入时不被持有。
> +
> +__releases  - 指定的锁在函数进入时被持有,但在退出时不被持有。
> +
> +如果函数在不持有锁的情况下进入和退出,在函数内部以平衡的方式获取和释放锁,则不
> +需要注释。
> +上面的三个注释是针对sparse否则会报告上下文不平衡的情况。
>
>  获取 sparse 工具
>  ~~~~~~~~~~~~~~~~
>
>  你可以从 Sparse 的主页获取最新的发布版本:
>
> -       http://www.kernel.org/pub/linux/kernel/people/josh/sparse/
> +       https://www.kernel.org/pub/software/devel/sparse/dist/
>
>  或者,你也可以使用 git 克隆最新的 sparse 开发版本:
>
> -       git://git.kernel.org/pub/scm/linux/kernel/git/josh/sparse.git
> +       git://git.kernel.org/pub/scm/devel/sparse/sparse.git
>
>  一旦你下载了源码,只要以普通用户身份运行:
>
>         make
>         make install
>
> -它将会被自动安装到你的 ~/bin 目录下。
> +如果是标准的用户,它将会被自动安装到你的~/bin目录下。
>
>  使用 sparse 工具
>  ~~~~~~~~~~~~~~~~
> --
> 2.27.0
>

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

* Re: [PATCH v2 1/2] docs/zh_CN: move sparse into dev-tools
  2021-11-03  2:46 ` [PATCH v2 1/2] docs/zh_CN: move sparse into dev-tools Yanteng Si
@ 2021-11-04 11:39   ` Alex Shi
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Shi @ 2021-11-04 11:39 UTC (permalink / raw)
  To: Yanteng Si
  Cc: Jonathan Corbet, Alex Shi, Wu X.C.,
	leoyang.li, Huacai Chen, Jiaxun Yang, Linux Doc Mailing List,
	Puyu Wang, Hu Haowen, Wan Jiabing, Bernard Zhao, Yanteng Si

Reviewed-by: Alex Shi <alexs@kernel.org>


On Wed, Nov 3, 2021 at 10:47 AM Yanteng Si <siyanteng01@gmail.com> wrote:
>
> From: Yanteng Si <siyanteng01@gmail.com>
>
> ../zh_CN/saprse.txt is alone at here, let's move it to ../zh_CN/dev-tools/sparse.rst.
>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  Documentation/translations/zh_CN/dev-tools/index.rst            | 2 +-
>  .../translations/zh_CN/{sparse.txt => dev-tools/sparse.rst}     | 0
>  2 files changed, 1 insertion(+), 1 deletion(-)
>  rename Documentation/translations/zh_CN/{sparse.txt => dev-tools/sparse.rst} (100%)
>
> diff --git a/Documentation/translations/zh_CN/dev-tools/index.rst b/Documentation/translations/zh_CN/dev-tools/index.rst
> index 0f770b8664e9..77a8c44cdf49 100644
> --- a/Documentation/translations/zh_CN/dev-tools/index.rst
> +++ b/Documentation/translations/zh_CN/dev-tools/index.rst
> @@ -22,13 +22,13 @@ Documentation/translations/zh_CN/dev-tools/testing-overview.rst
>     :maxdepth: 2
>
>     testing-overview
> +   sparse
>     gcov
>     kasan
>
>  Todolist:
>
>   - coccinelle
> - - sparse
>   - kcov
>   - ubsan
>   - kmemleak
> diff --git a/Documentation/translations/zh_CN/sparse.txt b/Documentation/translations/zh_CN/dev-tools/sparse.rst
> similarity index 100%
> rename from Documentation/translations/zh_CN/sparse.txt
> rename to Documentation/translations/zh_CN/dev-tools/sparse.rst
> --
> 2.27.0
>

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

end of thread, other threads:[~2021-11-04 11:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03  2:46 [PATCH v2 0/2] docs/zh_CN: move and update sparse Yanteng Si
2021-11-03  2:46 ` [PATCH v2 1/2] docs/zh_CN: move sparse into dev-tools Yanteng Si
2021-11-04 11:39   ` Alex Shi
2021-11-03  2:46 ` [PATCH v2 2/2] docs/zh_CN: update sparse translation Yanteng Si
2021-11-04 11:38   ` Alex Shi

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.