Skip to contentSkip to conversation

docs/zh_CN: move and update sparse

PATCH Superseded Yanteng Si 2 participants 7 messages Nov 1, 2021 – Nov 5, 2021

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Yanteng Si

author
#0 lore raw

cover docs/zh_CN: move and update sparse

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 +-
 .../translations/zh_CN/dev-tools/sparse.rst   | 108 ++++++++++++++++++
 Documentation/translations/zh_CN/sparse.txt   |  91 ---------------
 3 files changed, 109 insertions(+), 92 deletions(-)
 create mode 100644 Documentation/translations/zh_CN/dev-tools/sparse.rst
 delete mode 100644 Documentation/translations/zh_CN/sparse.txt
Signature · 1 line
2.27.0
author
#1 lore raw

PATCH 1/2 docs/zh_CN: move sparse into dev-tools

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

---
 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%)
Documentation/translations/zh_CN/dev-tools/index.rst +1 -1
index 0f770b8664e9..77a8c44cdf49 100644
@@ -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
Documentation/translations/zh_CN/dev-tools/sparse.rst renamed from Documentation/translations/zh_CN/sparse.txt +0 -0
similarity index 100%
rename from Documentation/translations/zh_CN/sparse.txt
rename to Documentation/translations/zh_CN/dev-tools/sparse.rst
Signature · 1 line
2.27.0
author
#2 lore raw

PATCH 2/2 docs/zh_CN: update sparse translation

In reply to Yanteng Si

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

---
 .../translations/zh_CN/dev-tools/sparse.rst   | 103 ++++++++++--------
 1 file changed, 60 insertions(+), 43 deletions(-)
Documentation/translations/zh_CN/dev-tools/sparse.rst +60 -43
index 0f444b83d639..405653d156d9 100644
@@ -1,34 +1,34 @@
-Chinese translated version of Documentation/dev-tools/sparse.rst
+Copyright 2004 Linus Torvalds
+Copyright 2004 Pavel Machek <[email protected]>
+Copyright 2006 Bob Copeland <[email protected]>
 
-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 <[email protected]>
----------------------------------------------------------------------
-Documentation/dev-tools/sparse.rst 的中文翻译
+:Original: Documentation/dev-tools/sparse.rst
 
-如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
-交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
-译存在问题,请联系中文版维护者。
+:翻译:
 
-中文版维护者: 李阳  Li Yang <[email protected]>
-中文版翻译者: 李阳  Li Yang <[email protected]>
+ Li Yang <[email protected]>
 
+:校译:
 
-以下为正文
----------------------------------------------------------------------
+ 司延腾 Yanteng Si <[email protected]>
 
-Copyright 2004 Linus Torvalds
-Copyright 2004 Pavel Machek <[email protected]>
-Copyright 2006 Bob Copeland <[email protected]>
+.. _cn_sparse:
+
+Sparse
+======
+
+Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一些潜在问题。 关
+于sparse的概述,请参见https://lwn.net/Articles/689907/;本文档包含
+一些针对内核的sparse信息。
+关于sparse的更多信息,主要是关于它的内部结构,可以在它的官方网页上找到:
+https://sparse.docs.kernel.org。
 
 使用 sparse 工具做类型检查
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-"__bitwise" 是一种类型属性,所以你应该这样使用它:
+``__bitwis`` 是一种类型属性,所以你应该这样使用它::
 
         typedef int __bitwise pm_request_t;
 
@@ -37,16 +37,16 @@ Copyright 2006 Bob Copeland <[email protected]>
                 PM_RESUME = (__force pm_request_t) 2
         };
 
-这样会使 PM_SUSPEND 和 PM_RESUME 成为位方式(bitwise)整数(使用"__force"
-是因为 sparse 会抱怨改变位方式的类型转换,但是这里我们确实需要强制进行转
-换)。而且因为所有枚举值都使用了相同的类型,这里的"enum pm_request"也将
-会使用那个类型做为底层实现。
+这样会使PM_SUSPEND和PM_RESUME成为位方式 ``bitwise`` 整数(使用
+``__force`` 是因为sparse会抱怨改变位方式的类型转换,但是这里我们确实
+需要强制进行转换)。而且因为所有枚举值都使用了相同的类型,这里的
+``enum pm_request`` 也将会使用那个类型做为底层实现。
 
-而且使用 gcc 编译的时候,所有的 __bitwise/__force 都会消失,最后在 gcc
-看来它们只不过是普通的整数。
+而且使用gcc编译的时候,所有的 ``__bitwise`` / ``__force`` 都会消失,
+最后在gcc看来它们只不过是普通的整数。
 
-坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成一个特殊的"int
-__bitwise"类型。
+坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成一个特殊的
+``int__bitwise`` 类型。
 
 所以更简单的办法只要这样做:
 
@@ -57,35 +57,52 @@ __bitwise"类型。
 
 现在你就有了严格的类型检查所需要的所有基础架构。
 
-一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方式整数使用而
-不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确保不同位方
-式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),对他们来说
-常数"0"确实是特殊的。
+一个小提醒:常数整数 ``0`` 是特殊的。你可以直接把常数零当作位方式整数使用而
+不用担心sparse会抱怨。这是因为 ``bitwise`` (恰如其名)是用来确保不同位方
+式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),对他们来说常数
+``0`` 确实 *是* 特殊的。
+
+使用sparse进行锁检查
+--------------------
+
+下面的宏对于gcc来说是未定义的,在sparse运行时定义,以使用sparse的 ``上下文``
+跟踪功能,应用于锁定。 这些注释告诉sparse什么时候有锁,以及注释的函数的进入和
+退出。
+
+__must_hold - 指定的锁在函数进入和退出时被持有。
+
+__acquires  - 指定的锁在函数退出时被持有,但在进入时不被持有。
+
+__releases  - 指定的锁在函数进入时被持有,但在退出时不被持有。
+
+如果函数在不持有锁的情况下进入和退出,在函数内部以平衡的方式获取和释放锁,则不
+需要注释。
+上面的三个注释是针对sparse否则会报告上下文不平衡的情况。
 
 获取 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克隆最新的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 工具
-~~~~~~~~~~~~~~~~
+使用sparse工具
+~~~~~~~~~~~~~~
 
-用"make C=1"命令来编译内核,会对所有重新编译的 C 文件使用 sparse 工具。
-或者使用"make C=2"命令,无论文件是否被重新编译都会对其使用 sparse 工具。
+用 ``make C=1`` 命令来编译内核,会对所有重新编译的C文件使用sparse工具。
+或者使用 ``make C=2`` 命令,无论文件是否被重新编译都会对其使用sparse工具。
 如果你已经编译了内核,用后一种方式可以很快地检查整个源码树。
 
-make 的可选变量 CHECKFLAGS 可以用来向 sparse 工具传递参数。编译系统会自
-动向 sparse 工具传递 -Wbitwise 参数。
+make的可选变量CHECKFLAGS可以用来向sparse工具传递参数。编译系统会自动向
+sparse工具传递-Wbitwise参数。
Signature · 1 line
2.27.0
#3 lore raw

RE: [PATCH 2/2] docs/zh_CN: update sparse translation

Quoted 90 lines

-----Original Message-----
From: Yanteng Si <[email protected]>
Sent: Monday, November 1, 2021 2:50 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Leo Li <[email protected]>
Cc: Yanteng Si <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH 2/2] docs/zh_CN: update sparse translation

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

---
 .../translations/zh_CN/dev-tools/sparse.rst   | 103 ++++++++++--------
 1 file changed, 60 insertions(+), 43 deletions(-)
Documentation/translations/zh_CN/dev-tools/sparse.rst +5 -10
index 0f444b83d639..405653d156d9 100644
@@ -1,34 +1,34 @@
-Chinese translated version of Documentation/dev-tools/sparse.rst
+Copyright 2004 Linus Torvalds
+Copyright 2004 Pavel Machek <[email protected]>
+Copyright 2006 Bob Copeland <[email protected]>
 
-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 <[email protected]>
----------------------------------------------------------------------
-Documentation/dev-tools/sparse.rst 的中文翻译
+:Original: Documentation/dev-tools/sparse.rst
 
-如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使

用英文
-交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时
或者翻
-译存在问题,请联系中文版维护者。
+:翻译:

-中文版维护者: 李阳 Li Yang <[email protected]>
-中文版翻译者: 李阳 Li Yang <[email protected]>
+ Li Yang <[email protected]>

+:校译:

-以下为正文
----------------------------------------------------------------------
+ 司延腾 Yanteng Si <[email protected]>

Documentation/translations/zh_CN/dev-tools/sparse.rst +6 -3
-Copyright 2004 Linus Torvalds
-Copyright 2004 Pavel Machek <[email protected]>
-Copyright 2006 Bob Copeland <[email protected]>
+.. _cn_sparse:
+
+Sparse
+======
+
+Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一些

潜在问题。 关
+于sparse的概述,请参见
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flwn.n
et%2FArticles%2F689907%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com %7C233b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c30 1635%7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8ey JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C1000&amp;sdata=6p2FGIcfWn%2BSrCmJaURoPa1K0NsGi0aD7psdJWDAb Mo%3D&amp;reserved=0;本文档包含
+一些针对内核的sparse信息。
+关于sparse的更多信息,主要是关于它的内部结构,可以在它的官方
网页上找到: +https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fspar se.docs.kernel.org%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C23 3b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c301635% 7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100 0&amp;sdata=HGfLzNLaFOAKiR288n2G%2FLrdaqeDO9T6IcJgb9o0VPw%3D&a mp;reserved=0。

Quoted 5 lines

使用 sparse 工具做类型检查
~~~~~~~~~~~~~~~~~~~~~~~~~~

-"__bitwise" 是一种类型属性,所以你应该这样使用它:
+``__bitwis`` 是一种类型属性,所以你应该这样使用它::

Typo. __bitwise.

Btw, not sure why you are changing all the " in original document to ``.

Quoted 48 lines
         typedef int __bitwise pm_request_t;
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -0
@@ -37,16 +37,16 @@ Copyright 2006 Bob Copeland

<[email protected]>
PM_RESUME = (__force pm_request_t) 2
};

-这样会使 PM_SUSPEND 和 PM_RESUME 成为位方式(bitwise)整数(使用
"__force"
-是因为 sparse 会抱怨改变位方式的类型转换,但是这里我们确实需要
强制进行转
-换)。而且因为所有枚举值都使用了相同的类型,这里的"enum
pm_request"也将
-会使用那个类型做为底层实现。
+这样会使PM_SUSPEND和PM_RESUME成为位方式 ``bitwise`` 整数(使
用
+``__force`` 是因为sparse会抱怨改变位方式的类型转换,但是这里我们
确实
+需要强制进行转换)。而且因为所有枚举值都使用了相同的类型,这
里的
+``enum pm_request`` 也将会使用那个类型做为底层实现。

-而且使用 gcc 编译的时候,所有的 __bitwise/__force 都会消失,最后在 gcc
-看来它们只不过是普通的整数。
+而且使用gcc编译的时候,所有的 ``__bitwise`` / ``__force`` 都会消失, +最后在gcc看来它们只不过是普通的整数。

-坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成一个
特殊的"int
-__bitwise"类型。
+坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成一
个特殊的
+``int__bitwise`` 类型。

所以更简单的办法只要这样做:

Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -1
@@ -57,35 +57,52 @@ __bitwise"类型。
 
 现在你就有了严格的类型检查所需要的所有基础架构。
 
-一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方式

整数使用而
-不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确保不
同位方
-式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),
对他们来说

Quoted 8 lines

-常数"0"确实是特殊的。
+一个小提醒:常数整数 ``0`` 是特殊的。你可以直接把常数零当作位方
式整数使用而
+不用担心sparse会抱怨。这是因为 ``bitwise`` (恰如其名)是用来确保
不同位方
+式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),
对他们来说常数
+``0`` 确实 *是* 特殊的。

Not sure if the italic is a standard way to emphasis in Chinese, maybe bold more common.

Quoted 82 lines
Documentation/translations/zh_CN/dev-tools/sparse.rst +5 -0
+
+使用sparse进行锁检查
+--------------------
+
+下面的宏对于gcc来说是未定义的,在sparse运行时定义,以使用

sparse的 ``上下文``
+跟踪功能,应用于锁定。 这些注释告诉sparse什么时候有锁,以及注
释的函数的进入和
+退出。

Documentation/translations/zh_CN/dev-tools/sparse.rst +8 -0
+
+__must_hold - 指定的锁在函数进入和退出时被持有。
+
+__acquires  - 指定的锁在函数退出时被持有,但在进入时不被持有。
+
+__releases  - 指定的锁在函数进入时被持有,但在退出时不被持有。
+
+如果函数在不持有锁的情况下进入和退出,在函数内部以平衡的方式

获取和释放锁,则不
+需要注释。
+上面的三个注释是针对sparse否则会报告上下文不平衡的情况。

获取 sparse 工具
~~~~~~~~~~~~~~~~

-你可以从 Sparse 的主页获取最新的发布版本:
+你可以从Sparse的主页获取最新的发布版本:

-

	https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2

Fwww.kernel.org%2Fpub%2Flinux%2Fkernel%2Fpeople%2Fjosh%2Fsparse% 2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C233b2566e2f74928165 c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63771 3498814921046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC JQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=opa QpoTYC2szu9dxnBbbG9%2BPM5rJ%2Fi%2BnzUnoRxP%2BOKQ%3D&amp;res erved=0
+

	https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%

2Fwww.kernel.org%2Fpub%2Fsoftware%2Fdevel%2Fsparse%2Fdist%2F&am p;data=04%7C01%7Cleoyang.li%40nxp.com%7C233b2566e2f74928165c08d99 d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63771349881 4921046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7v7oad%2B TDfHAS0Im2SsRFZfwh1YpaLjCH9vqsfFBTjA%3D&amp;reserved=0

-或者,你也可以使用 git 克隆最新的 sparse 开发版本:
+或者,你也可以使用git克隆最新的sparse开发版本:

Documentation/translations/zh_CN/dev-tools/sparse.rst +4 -5
-	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 工具
-~~~~~~~~~~~~~~~~
+使用sparse工具
+~~~~~~~~~~~~~~
 
-用"make C=1"命令来编译内核,会对所有重新编译的 C 文件使用 sparse

工具。
-或者使用"make C=2"命令,无论文件是否被重新编译都会对其使用
sparse 工具。
+用 ``make C=1`` 命令来编译内核,会对所有重新编译的C文件使用
sparse工具。
+或者使用 ``make C=2`` 命令,无论文件是否被重新编译都会对其使用
sparse工具。
如果你已经编译了内核,用后一种方式可以很快地检查整个源码树。

-make 的可选变量 CHECKFLAGS 可以用来向 sparse 工具传递参数。编译
系统会自
-动向 sparse 工具传递 -Wbitwise 参数。
+make的可选变量CHECKFLAGS可以用来向sparse工具传递参数。编译
系统会自动向
+sparse工具传递-Wbitwise参数。
--
2.27.0

author
#4 lore raw

Re: [PATCH 2/2] docs/zh_CN: update sparse translation

Quoted 91 lines · Leo Li <[email protected]> 于2021年11月2日周二 上午5:02写道:
Quoted 91 lines

-----Original Message-----
From: Yanteng Si <[email protected]>
Sent: Monday, November 1, 2021 2:50 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Leo Li <[email protected]>
Cc: Yanteng Si <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH 2/2] docs/zh_CN: update sparse translation

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

---
 .../translations/zh_CN/dev-tools/sparse.rst   | 103 ++++++++++--------
 1 file changed, 60 insertions(+), 43 deletions(-)
Documentation/translations/zh_CN/dev-tools/sparse.rst +5 -10
index 0f444b83d639..405653d156d9 100644
@@ -1,34 +1,34 @@
-Chinese translated version of Documentation/dev-tools/sparse.rst
+Copyright 2004 Linus Torvalds
+Copyright 2004 Pavel Machek <[email protected]>
+Copyright 2006 Bob Copeland <[email protected]>
 
-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 <[email protected]>
----------------------------------------------------------------------
-Documentation/dev-tools/sparse.rst 的中文翻译
+:Original: Documentation/dev-tools/sparse.rst
 
-如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使

用英文
-交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时
或者翻
-译存在问题,请联系中文版维护者。
+:翻译:

-中文版维护者: 李阳 Li Yang <[email protected]>
-中文版翻译者: 李阳 Li Yang <[email protected]>
+ Li Yang <[email protected]>

+:校译:

-以下为正文
----------------------------------------------------------------------
+ 司延腾 Yanteng Si <[email protected]>

Documentation/translations/zh_CN/dev-tools/sparse.rst +6 -3
-Copyright 2004 Linus Torvalds
-Copyright 2004 Pavel Machek <[email protected]>
-Copyright 2006 Bob Copeland <[email protected]>
+.. _cn_sparse:
+
+Sparse
+======
+
+Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一些

潜在问题。 关
+于sparse的概述,请参见
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flwn.n
et%2FArticles%2F689907%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com %7C233b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c30 1635%7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8ey JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C1000&amp;sdata=6p2FGIcfWn%2BSrCmJaURoPa1K0NsGi0aD7psdJWDAb Mo%3D&amp;reserved=0;本文档包含
+一些针对内核的sparse信息。
+关于sparse的更多信息,主要是关于它的内部结构,可以在它的官方
网页上找到: +https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fspar se.docs.kernel.org%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C23 3b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c301635% 7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100 0&amp;sdata=HGfLzNLaFOAKiR288n2G%2FLrdaqeDO9T6IcJgb9o0VPw%3D&a mp;reserved=0。

Quoted 7 lines
Quoted 5 lines

使用 sparse 工具做类型检查
~~~~~~~~~~~~~~~~~~~~~~~~~~

-"__bitwise" 是一种类型属性,所以你应该这样使用它:
+``__bitwis`` 是一种类型属性,所以你应该这样使用它::

Typo. __bitwise.

OK,Thanks!

Quoted 2 lines

Btw, not sure why you are changing all the " in original document to ``.

sorry,I will recover back!

Quoted 43 lines
Quoted 43 lines

         typedef int __bitwise pm_request_t;
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -0
@@ -37,16 +37,16 @@ Copyright 2006 Bob Copeland

<[email protected]>
PM_RESUME = (__force pm_request_t) 2
};

-这样会使 PM_SUSPEND 和 PM_RESUME 成为位方式(bitwise)整数(使用
"__force"
-是因为 sparse 会抱怨改变位方式的类型转换,但是这里我们确实需要
强制进行转
-换)。而且因为所有枚举值都使用了相同的类型,这里的"enum
pm_request"也将
-会使用那个类型做为底层实现。
+这样会使PM_SUSPEND和PM_RESUME成为位方式 ``bitwise`` 整数(使
用
+``__force`` 是因为sparse会抱怨改变位方式的类型转换,但是这里我们
确实
+需要强制进行转换)。而且因为所有枚举值都使用了相同的类型,这
里的
+``enum pm_request`` 也将会使用那个类型做为底层实现。

-而且使用 gcc 编译的时候,所有的 __bitwise/__force 都会消失,最后在 gcc
-看来它们只不过是普通的整数。
+而且使用gcc编译的时候,所有的 ``__bitwise`` / ``__force`` 都会消失, +最后在gcc看来它们只不过是普通的整数。

-坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成一个
特殊的"int
-__bitwise"类型。
+坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成一
个特殊的
+``int__bitwise`` 类型。

所以更简单的办法只要这样做:

Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -0
@@ -57,35 +57,52 @@ __bitwise"类型。
 
 现在你就有了严格的类型检查所需要的所有基础架构。
 
Quoted 16 lines
Quoted 6 lines
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -1
-一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方式

整数使用而
-不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确保不
同位方
-式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),
对他们来说

Quoted 8 lines

-常数"0"确实是特殊的。
+一个小提醒:常数整数 ``0`` 是特殊的。你可以直接把常数零当作位方
式整数使用而
+不用担心sparse会抱怨。这是因为 ``bitwise`` (恰如其名)是用来确保
不同位方
+式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其他),
对他们来说常数
+``0`` 确实 *是* 特殊的。

Not sure if the italic is a standard way to emphasis in Chinese, maybe bold more common.

yes, "*是*" is bold,Thanks.

Thanks,
Yanteng

#5 lore raw

RE: [PATCH 2/2] docs/zh_CN: update sparse translation

Quoted 215 lines

-----Original Message-----
From: yanteng si <[email protected]>
Sent: Tuesday, November 2, 2021 3:52 AM
To: Leo Li <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Yanteng Si <[email protected]>; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 2/2] docs/zh_CN: update sparse translation

Quoted 40 lines · Leo Li <[email protected]> 于2021年11月2日周二 上午5:02写道:
Quoted 40 lines

-----Original Message-----
From: Yanteng Si <[email protected]>
Sent: Monday, November 1, 2021 2:50 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Leo Li <[email protected]>
Cc: Yanteng Si <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH 2/2] docs/zh_CN: update sparse translation

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

---
 .../translations/zh_CN/dev-tools/sparse.rst   | 103 ++++++++++--------
 1 file changed, 60 insertions(+), 43 deletions(-)
Documentation/translations/zh_CN/dev-tools/sparse.rst +3 -2
index 0f444b83d639..405653d156d9 100644
@@ -1,34 +1,34 @@
-Chinese translated version of Documentation/dev-tools/sparse.rst
+Copyright 2004 Linus Torvalds
+Copyright 2004 Pavel Machek <[email protected]> Copyright 2006 Bob
+Copeland <[email protected]>
 
-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

Quoted 6 lines
Quoted 6 lines

-Chinese maintainer: Li Yang <[email protected]>
--------------------------------------------------------------------
-- -Documentation/dev-tools/sparse.rst 的中文翻译
+:Original: Documentation/dev-tools/sparse.rst

-如果想评论或更新本文的内容,请直接联系原文档的维护者。如果

你使

Quoted 2 lines
Quoted 2 lines

用英文
-交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不

及时

Quoted 15 lines
Quoted 15 lines

或者翻
-译存在问题,请联系中文版维护者。
+:翻译:

-中文版维护者: 李阳 Li Yang <[email protected]>
-中文版翻译者: 李阳 Li Yang <[email protected]>
+ Li Yang <[email protected]>

+:校译:

-以下为正文
--------------------------------------------------------------------
--
+ 司延腾 Yanteng Si <[email protected]>

Quoted 9 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst

Quoted 9 lines
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -2
-Copyright 2004 Linus Torvalds
-Copyright 2004 Pavel Machek <[email protected]> -Copyright 2006 Bob

Copeland <[email protected]>
+.. _cn_sparse:

Documentation/translations/zh_CN/dev-tools/sparse.rst +5 -0
+
+Sparse
+======
+
+Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一

些

Quoted 3 lines
Quoted 3 lines

潜在问题。 关
+于sparse的概述,请参见

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flw

Quoted 1 line
Quoted 1 line

n.n%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C779b119cb785486 8054

Quoted 1 line
Quoted 1 line

708d99dde188f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63771 4399

Quoted 1 line
Quoted 1 line

496081646%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj oiV2luMz

Quoted 1 line
Quoted 1 line

IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ohSPyKOTZFiwB2 %2F%

Quoted 2 lines
Quoted 2 lines

2BDXR2%2BDJk1avo9MJXUVLP7q%2Fw%2FI0%3D&amp;reserved=0

et%2FArticles%2F689907%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com

Quoted 1 line
Quoted 1 line

%7C233b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c

5c30

Quoted 1 line
Quoted 1 line

1635%7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8ey

Quoted 1 line
Quoted 1 line

JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%

Quoted 1 line
Quoted 1 line

7C1000&amp;sdata=6p2FGIcfWn%2BSrCmJaURoPa1K0NsGi0aD7psdJWDAb

Quoted 3 lines
Quoted 3 lines

Mo%3D&amp;reserved=0;本文档包含
+一些针对内核的sparse信息。
+关于sparse的更多信息,主要是关于它的内部结构,可以在它的官

方

Quoted 2 lines
Quoted 2 lines

网页上找到:

+https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fs

Quoted 2 lines
Quoted 2 lines

+par

se.docs.kernel.org%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C23

Quoted 1 line
Quoted 1 line

3b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c301635%

Quoted 1 line
Quoted 1 line

7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi

Quoted 1 line
Quoted 1 line

MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100

Quoted 1 line
Quoted 1 line

0&amp;sdata=HGfLzNLaFOAKiR288n2G%2FLrdaqeDO9T6IcJgb9o0VPw%3D&a

Quoted 9 lines
Quoted 7 lines

mp;reserved=0。

使用 sparse 工具做类型检查
~~~~~~~~~~~~~~~~~~~~~~~~~~

-"__bitwise" 是一种类型属性,所以你应该这样使用它:
+``__bitwis`` 是一种类型属性,所以你应该这样使用它::

Typo. __bitwise.

OK,Thanks!

Quoted 2 lines

Btw, not sure why you are changing all the " in original document to ``.

sorry,I will recover back!

Quoted 5 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst Copyright 2006 Bob Copeland

Quoted 5 lines

         typedef int __bitwise pm_request_t;
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -0
@@ -37,16 +37,16 @@ Copyright 2006 Bob Copeland

<[email protected]>

Quoted 4 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst Copyright 2006 Bob Copeland <[email protected]>

Quoted 4 lines
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -1
                 PM_RESUME = (__force pm_request_t) 2
         };
 
-这样会使 PM_SUSPEND 和 PM_RESUME 成为位方式(bitwise)整数

(使用

Quoted 2 lines
Quoted 2 lines

"__force"
-是因为 sparse 会抱怨改变位方式的类型转换,但是这里我们确实需

要

Quoted 5 lines
Quoted 5 lines

强制进行转
-换)。而且因为所有枚举值都使用了相同的类型,这里的"enum
pm_request"也将
-会使用那个类型做为底层实现。
+这样会使PM_SUSPEND和PM_RESUME成为位方式 ``bitwise`` 整数

(使

Quoted 2 lines
Quoted 2 lines

用
+``__force`` 是因为sparse会抱怨改变位方式的类型转换,但是这里

我们

Quoted 2 lines
Quoted 2 lines

确实
+需要强制进行转换)。而且因为所有枚举值都使用了相同的类型,

这

Quoted 4 lines
Quoted 4 lines

里的
+``enum pm_request`` 也将会使用那个类型做为底层实现。

-而且使用 gcc 编译的时候,所有的 __bitwise/__force 都会消失,最

后在

Quoted 6 lines
Quoted 6 lines

gcc
-看来它们只不过是普通的整数。
+而且使用gcc编译的时候,所有的 ``__bitwise`` / ``__force`` 都会消失, +最后在gcc看来它们只不过是普通的整数。

-坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成

一个

Quoted 3 lines
Quoted 3 lines

特殊的"int
-__bitwise"类型。
+坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成

一

Quoted 10 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst __bitwise"类型。 · line 60

Quoted 10 lines

个特殊的
+``int__bitwise`` 类型。

所以更简单的办法只要这样做:

Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -1
@@ -57,35 +57,52 @@ __bitwise"类型。
 
 现在你就有了严格的类型检查所需要的所有基础架构。
 
-一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方

式

Quoted 2 lines
Quoted 2 lines

整数使用而
-不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确

保不

Quoted 2 lines
Quoted 2 lines

同位方
-式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其

他),

Quoted 3 lines
Quoted 3 lines

对他们来说
-常数"0"确实是特殊的。
+一个小提醒:常数整数 ``0`` 是特殊的。你可以直接把常数零当作位

方

Quoted 2 lines
Quoted 2 lines

式整数使用而
+不用担心sparse会抱怨。这是因为 ``bitwise`` (恰如其名)是用来

确保

Quoted 2 lines
Quoted 2 lines

不同位方
+式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其

Quoted 7 lines

他),

Quoted 4 lines
Quoted 2 lines

对他们来说常数
+``0`` 确实 *是* 特殊的。

Not sure if the italic is a standard way to emphasis in Chinese, maybe bold

more common.
yes, "*是*" is bold,Thanks.

According to the document here https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html#inline-markup-and-special-characters-e-g-bold-italic-verbatim

The *italic* is for italic, while **bold** is for bold.

author
#6 lore raw

Re: [PATCH 2/2] docs/zh_CN: update sparse translation

Quoted 216 lines · Leo Li <[email protected]> 于2021年11月5日周五 上午9:56写道:
Quoted 216 lines

-----Original Message-----
From: yanteng si <[email protected]>
Sent: Tuesday, November 2, 2021 3:52 AM
To: Leo Li <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Yanteng Si <[email protected]>; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 2/2] docs/zh_CN: update sparse translation

Quoted 40 lines · Leo Li <[email protected]> 于2021年11月2日周二 上午5:02写道:
Quoted 40 lines

-----Original Message-----
From: Yanteng Si <[email protected]>
Sent: Monday, November 1, 2021 2:50 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; Leo Li <[email protected]>
Cc: Yanteng Si <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH 2/2] docs/zh_CN: update sparse translation

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

---
 .../translations/zh_CN/dev-tools/sparse.rst   | 103 ++++++++++--------
 1 file changed, 60 insertions(+), 43 deletions(-)
Documentation/translations/zh_CN/dev-tools/sparse.rst +3 -2
index 0f444b83d639..405653d156d9 100644
@@ -1,34 +1,34 @@
-Chinese translated version of Documentation/dev-tools/sparse.rst
+Copyright 2004 Linus Torvalds
+Copyright 2004 Pavel Machek <[email protected]> Copyright 2006 Bob
+Copeland <[email protected]>
 
-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

Quoted 6 lines
Quoted 6 lines

-Chinese maintainer: Li Yang <[email protected]>
--------------------------------------------------------------------
-- -Documentation/dev-tools/sparse.rst 的中文翻译
+:Original: Documentation/dev-tools/sparse.rst

-如果想评论或更新本文的内容,请直接联系原文档的维护者。如果

你使

Quoted 2 lines
Quoted 2 lines

用英文
-交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不

及时

Quoted 15 lines
Quoted 15 lines

或者翻
-译存在问题,请联系中文版维护者。
+:翻译:

-中文版维护者: 李阳 Li Yang <[email protected]>
-中文版翻译者: 李阳 Li Yang <[email protected]>
+ Li Yang <[email protected]>

+:校译:

-以下为正文
--------------------------------------------------------------------
--
+ 司延腾 Yanteng Si <[email protected]>

Quoted 9 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst

Quoted 9 lines
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -2
-Copyright 2004 Linus Torvalds
-Copyright 2004 Pavel Machek <[email protected]> -Copyright 2006 Bob

Copeland <[email protected]>
+.. _cn_sparse:

Documentation/translations/zh_CN/dev-tools/sparse.rst +5 -0
+
+Sparse
+======
+
+Sparse是一个C程序的语义检查器;它可以用来发现内核代码的一

些

Quoted 3 lines
Quoted 3 lines

潜在问题。 关
+于sparse的概述,请参见

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flw

Quoted 1 line
Quoted 1 line

n.n%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C779b119cb785486 8054

Quoted 1 line
Quoted 1 line

708d99dde188f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63771 4399

Quoted 1 line
Quoted 1 line

496081646%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj oiV2luMz

Quoted 1 line
Quoted 1 line

IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ohSPyKOTZFiwB2 %2F%

Quoted 2 lines
Quoted 2 lines

2BDXR2%2BDJk1avo9MJXUVLP7q%2Fw%2FI0%3D&amp;reserved=0

et%2FArticles%2F689907%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com

Quoted 1 line
Quoted 1 line

%7C233b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c

5c30

Quoted 1 line
Quoted 1 line

1635%7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8ey

Quoted 1 line
Quoted 1 line

JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%

Quoted 1 line
Quoted 1 line

7C1000&amp;sdata=6p2FGIcfWn%2BSrCmJaURoPa1K0NsGi0aD7psdJWDAb

Quoted 3 lines
Quoted 3 lines

Mo%3D&amp;reserved=0;本文档包含
+一些针对内核的sparse信息。
+关于sparse的更多信息,主要是关于它的内部结构,可以在它的官

方

Quoted 2 lines
Quoted 2 lines

网页上找到:

+https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fs

Quoted 2 lines
Quoted 2 lines

+par

se.docs.kernel.org%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C23

Quoted 1 line
Quoted 1 line

3b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c5c301635%

Quoted 1 line
Quoted 1 line

7C0%7C0%7C637713498814921046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi

Quoted 1 line
Quoted 1 line

MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100

Quoted 1 line
Quoted 1 line

0&amp;sdata=HGfLzNLaFOAKiR288n2G%2FLrdaqeDO9T6IcJgb9o0VPw%3D&a

Quoted 9 lines
Quoted 7 lines

mp;reserved=0。

使用 sparse 工具做类型检查
~~~~~~~~~~~~~~~~~~~~~~~~~~

-"__bitwise" 是一种类型属性,所以你应该这样使用它:
+``__bitwis`` 是一种类型属性,所以你应该这样使用它::

Typo. __bitwise.

OK,Thanks!

Quoted 2 lines

Btw, not sure why you are changing all the " in original document to ``.

sorry,I will recover back!

Quoted 5 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst Copyright 2006 Bob Copeland

Quoted 5 lines

         typedef int __bitwise pm_request_t;
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -0
@@ -37,16 +37,16 @@ Copyright 2006 Bob Copeland

<[email protected]>

Quoted 4 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst Copyright 2006 Bob Copeland <[email protected]>

Quoted 4 lines
Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -1
                 PM_RESUME = (__force pm_request_t) 2
         };
 
-这样会使 PM_SUSPEND 和 PM_RESUME 成为位方式(bitwise)整数

(使用

Quoted 2 lines
Quoted 2 lines

"__force"
-是因为 sparse 会抱怨改变位方式的类型转换,但是这里我们确实需

要

Quoted 5 lines
Quoted 5 lines

强制进行转
-换)。而且因为所有枚举值都使用了相同的类型,这里的"enum
pm_request"也将
-会使用那个类型做为底层实现。
+这样会使PM_SUSPEND和PM_RESUME成为位方式 ``bitwise`` 整数

(使

Quoted 2 lines
Quoted 2 lines

用
+``__force`` 是因为sparse会抱怨改变位方式的类型转换,但是这里

我们

Quoted 2 lines
Quoted 2 lines

确实
+需要强制进行转换)。而且因为所有枚举值都使用了相同的类型,

这

Quoted 4 lines
Quoted 4 lines

里的
+``enum pm_request`` 也将会使用那个类型做为底层实现。

-而且使用 gcc 编译的时候,所有的 __bitwise/__force 都会消失,最

后在

Quoted 6 lines
Quoted 6 lines

gcc
-看来它们只不过是普通的整数。
+而且使用gcc编译的时候,所有的 ``__bitwise`` / ``__force`` 都会消失, +最后在gcc看来它们只不过是普通的整数。

-坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成

一个

Quoted 3 lines
Quoted 3 lines

特殊的"int
-__bitwise"类型。
+坦白来说,你并不需要使用枚举类型。上面那些实际都可以浓缩成

一

Quoted 10 lines

Documentation/translations/zh_CN/dev-tools/sparse.rst __bitwise"类型。 · line 60

Quoted 10 lines

个特殊的
+``int__bitwise`` 类型。

所以更简单的办法只要这样做:

Documentation/translations/zh_CN/dev-tools/sparse.rst +0 -1
@@ -57,35 +57,52 @@ __bitwise"类型。
 
 现在你就有了严格的类型检查所需要的所有基础架构。
 
-一个小提醒:常数整数"0"是特殊的。你可以直接把常数零当作位方

式

Quoted 2 lines
Quoted 2 lines

整数使用而
-不用担心 sparse 会抱怨。这是因为"bitwise"(恰如其名)是用来确

保不

Quoted 2 lines
Quoted 2 lines

同位方
-式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其

他),

Quoted 3 lines
Quoted 3 lines

对他们来说
-常数"0"确实是特殊的。
+一个小提醒:常数整数 ``0`` 是特殊的。你可以直接把常数零当作位

方

Quoted 2 lines
Quoted 2 lines

式整数使用而
+不用担心sparse会抱怨。这是因为 ``bitwise`` (恰如其名)是用来

确保

Quoted 2 lines
Quoted 2 lines

不同位方
+式类型不会被弄混(小尾模式,大尾模式,cpu尾模式,或者其

Quoted 7 lines
Quoted 7 lines

他),

Quoted 4 lines
Quoted 2 lines

对他们来说常数
+``0`` 确实 *是* 特殊的。

Not sure if the italic is a standard way to emphasis in Chinese, maybe bold

more common.
yes, "*是*" is bold,Thanks.

Sorry, I got the symbols mixed up. T_T

Thanks,
Yanteng