All of lore.kernel.org
 help / color / mirror / Atom feed
From: yanteng si <siyanteng01@gmail.com>
To: Leo Li <leoyang.li@nxp.com>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
	"alexs@kernel.org" <alexs@kernel.org>,
	"bobwxc@email.cn" <bobwxc@email.cn>,
	"seakeel@gmail.com" <seakeel@gmail.com>,
	Yanteng Si <siyanteng@loongson.cn>,
	"chenhuacai@kernel.org" <chenhuacai@kernel.org>,
	"jiaxun.yang@flygoat.com" <jiaxun.yang@flygoat.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"realpuyuwang@gmail.com" <realpuyuwang@gmail.com>,
	"src.res@email.cn" <src.res@email.cn>,
	"wanjiabing@vivo.com" <wanjiabing@vivo.com>,
	"bernard@vivo.com" <bernard@vivo.com>
Subject: Re: [PATCH 2/2] docs/zh_CN: update sparse translation
Date: Fri, 5 Nov 2021 10:07:08 +0800	[thread overview]
Message-ID: <CAEensMwUKOqB82vwZZ2zO7ALnrRqtqOJ5M6bqa6D3Mo6ZzPMfg@mail.gmail.com> (raw)
In-Reply-To: <AS8PR04MB89468C71C5A853C7515A6FA38F8E9@AS8PR04MB8946.eurprd04.prod.outlook.com>

Leo Li <leoyang.li@nxp.com> 于2021年11月5日周五 上午9:56写道:
>
>
>
> > -----Original Message-----
> > From: yanteng si <siyanteng01@gmail.com>
> > Sent: Tuesday, November 2, 2021 3:52 AM
> > To: Leo Li <leoyang.li@nxp.com>
> > Cc: corbet@lwn.net; alexs@kernel.org; bobwxc@email.cn;
> > seakeel@gmail.com; Yanteng Si <siyanteng@loongson.cn>;
> > chenhuacai@kernel.org; jiaxun.yang@flygoat.com; linux-
> > doc@vger.kernel.org; realpuyuwang@gmail.com; src.res@email.cn;
> > wanjiabing@vivo.com; bernard@vivo.com
> > Subject: Re: [PATCH 2/2] docs/zh_CN: update sparse translation
> >
> > Leo Li <leoyang.li@nxp.com> 于2021年11月2日周二 上午5:02写道:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Yanteng Si <siyanteng01@gmail.com>
> > > > Sent: Monday, November 1, 2021 2:50 AM
> > > > To: corbet@lwn.net; alexs@kernel.org; bobwxc@email.cn;
> > > > seakeel@gmail.com; Leo Li <leoyang.li@nxp.com>
> > > > Cc: Yanteng Si <siyanteng@loongson.cn>; chenhuacai@kernel.org;
> > > > jiaxun.yang@flygoat.com; linux-doc@vger.kernel.org;
> > > > realpuyuwang@gmail.com; siyanteng01@gmail.com; src.res@email.cn;
> > > > wanjiabing@vivo.com; bernard@vivo.com
> > > > Subject: [PATCH 2/2] docs/zh_CN: update sparse translation
> > > >
> > > > 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   | 103 ++++++++++--------
> > > >  1 file changed, 60 insertions(+), 43 deletions(-)
> > > >
> > > > diff --git a/Documentation/translations/zh_CN/dev-tools/sparse.rst
> > > > b/Documentation/translations/zh_CN/dev-tools/sparse.rst
> > > > index 0f444b83d639..405653d156d9 100644
> > > > --- a/Documentation/translations/zh_CN/dev-tools/sparse.rst
> > > > +++ b/Documentation/translations/zh_CN/dev-tools/sparse.rst
> > > > @@ -1,34 +1,34 @@
> > > > -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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flw
> > > >
> > n.n%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com%7C779b119cb785486
> > 8054
> > > >
> > 708d99dde188f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63771
> > 4399
> > > >
> > 496081646%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj
> > oiV2luMz
> > > >
> > IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ohSPyKOTZFiwB2
> > %2F%
> > > > 2BDXR2%2BDJk1avo9MJXUVLP7q%2Fw%2FI0%3D&amp;reserved=0
> > > >
> > et%2FArticles%2F689907%2F&amp;data=04%7C01%7Cleoyang.li%40nxp.com
> > > > %7C233b2566e2f74928165c08d99d0c644c%7C686ea1d3bc2b4c6fa92cd99c
> > 5c30
> > > >
> > 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%2Fs
> > > > +par
> > > >
> > 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。
> > > >
> > > >  使用 sparse 工具做类型检查
> > > >  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > >
> > > > -"__bitwise" 是一种类型属性,所以你应该这样使用它:
> > > > +``__bitwis`` 是一种类型属性,所以你应该这样使用它::
> > >
> > > Typo.  __bitwise.
> > OK,Thanks!
> > >
> > > Btw, not sure why you are changing all the " in original document to ``.
> > sorry,I will recover back!
> > >
> > > >
> > > >          typedef int __bitwise pm_request_t;
> > > >
> > > > @@ -37,16 +37,16 @@ Copyright 2006 Bob Copeland
> > <me@bobcopeland.com>
> > > >                  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`` 确实 *是* 特殊的。
> > >
> > > 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

      reply	other threads:[~2021-11-05  2:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  7:50 [PATCH 0/2] docs/zh_CN: move and update sparse Yanteng Si
2021-11-01  7:50 ` [PATCH 1/2] docs/zh_CN: move sparse into dev-tools Yanteng Si
2021-11-01  7:50 ` [PATCH 2/2] docs/zh_CN: update sparse translation Yanteng Si
2021-11-01 21:01   ` Leo Li
2021-11-02  8:52     ` yanteng si
2021-11-05  1:56       ` Leo Li
2021-11-05  2:07         ` yanteng si [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEensMwUKOqB82vwZZ2zO7ALnrRqtqOJ5M6bqa6D3Mo6ZzPMfg@mail.gmail.com \
    --to=siyanteng01@gmail.com \
    --cc=alexs@kernel.org \
    --cc=bernard@vivo.com \
    --cc=bobwxc@email.cn \
    --cc=chenhuacai@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=realpuyuwang@gmail.com \
    --cc=seakeel@gmail.com \
    --cc=siyanteng@loongson.cn \
    --cc=src.res@email.cn \
    --cc=wanjiabing@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.