From: Weijie Yuan <wy@wyuan.org>
To: Chen-Yu Yeh <chenyou910331@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>, Alex Shi <alexs@kernel.org>,
Dongliang Mu <dzm91@hust.edu.cn>,
Yanteng Si <si.yanteng@linux.dev>,
Hu Haowen <2023002089@link.tyut.edu.cn>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/16] docs/zh_TW: process: localize terminology in coding-style.rst
Date: Wed, 22 Jul 2026 22:48:26 +0800 [thread overview]
Message-ID: <amDYOmUlDWCOCa4M@wyuan.org> (raw)
In-Reply-To: <20260721215542.98435-8-chenyou910331@gmail.com>
On Wed, Jul 22, 2026 at 05:55:33AM +0800, Chen-Yu Yeh wrote:
> Localize mainland terms to Taiwanese Mandarin (內核→核心, 函數→函式,
> 宏→巨集, 枚舉→列舉, 聲明→宣告, 寄存器→暫存器, ...) and sync with the
> English original: update the memory allocator list and array
> allocation examples to the type-aware kmalloc_objs()/kzalloc_objs()
> forms.
>
> update to commit 323fa4b9608b ("Documentation: Fix syntax of kmalloc_objs example in coding style doc")
>
> Signed-off-by: Chen-Yu Yeh <chenyou910331@gmail.com>
Except the wrapping issue of the commit message (leave it to the
maintainers to handle it):
Reviewed-by: Weijie Yuan <wy@wyuan.org>
> ---
> .../zh_TW/process/coding-style.rst | 580 +++++++++---------
> 1 file changed, 292 insertions(+), 288 deletions(-)
>
[...]
> 9) 你已經把事情弄糟了
> ---------------------
>
> 這沒什麼,我們都是這樣。可能你長期使用 Unix 的朋友已經告訴你
> -``GNU emacs`` 能自動幫你格式化 C 源代碼,而且你也注意到了,確實是這樣,不過它
> -所使用的默認值和我們想要的相去甚遠 (實際上,甚至比隨機打的還要差——無數個猴子
> -在 GNU emacs 裏打字永遠不會創造出一個好程序)
> +``GNU emacs`` 能自動幫你格式化 C 原始程式碼,而且你也注意到了,確實是這樣,不過它
> +所使用的預設值和我們想要的相去甚遠 (實際上,甚至比隨機打的還要差——無數個猴子
> +在 GNU emacs 裡打字永遠不會創造出一個好程式)
Change to:
``GNU emacs`` 能自動幫你格式化 C 原始程式碼,而且你也注意到了,確實是這樣,
不過它所使用的預設值和我們想要的相去甚遠 (實際上,甚至比隨機打的還要差——
無數個猴子在 GNU emacs 裡打字永遠不會創造出一個好程式)
?
> *(譯註:Infinite Monkey Theorem)*
>
> 所以你要麼放棄 GNU emacs,要麼改變它讓它使用更合理的設定。要採用後一個方案,
> -你可以把下面這段粘貼到你的 .emacs 文件裏。
> +你可以把下面這段貼上到你的 .emacs 檔案裡。
>
> .. code-block:: elisp
>
> @@ -640,31 +641,31 @@ Documentation/translations/zh_CN/doc-guide/index.rst 和 tools/docs/kernel-doc
> (expand-file-name "~/src/linux-trees")
> 'linux-kernel)
>
> -這會讓 emacs 在 ``~/src/linux-trees`` 下的 C 源文件獲得更好的內核代碼風格。
> +這會讓 emacs 在 ``~/src/linux-trees`` 下的 C 原始檔獲得更好的核心程式碼風格。
>
> -不過就算你嘗試讓 emacs 正確的格式化代碼失敗了,也並不意味着你失去了一切:還可
> +不過就算你嘗試讓 emacs 正確的格式化程式碼失敗了,也並不意味著你失去了一切:還可
> 以用 ``indent`` 。
>
> 不過,GNU indent 也有和 GNU emacs 一樣有問題的設定,所以你需要給它一些命令選
> -項。不過,這還不算太糟糕,因爲就算是 GNU indent 的作者也認同 K&R 的權威性
> +項。不過,這還不算太糟糕,因為就算是 GNU indent 的作者也認同 K&R 的權威性
> (GNU 的人並不是壞人,他們只是在這個問題上被嚴重的誤導了),所以你只要給 indent
> -指定選項 ``-kr -i8`` (代表 ``K&R,8 字符縮進``),或使用 ``scripts/Lindent``
> -這樣就可以以最時髦的方式縮進源代碼。
> +指定選項 ``-kr -i8`` (代表 ``K&R,8 字元縮排``),或使用 ``scripts/Lindent``
> +這樣就可以以最時髦的方式縮排原始程式碼。
>
> -``indent`` 有很多選項,特別是重新格式化註釋的時候,你可能需要看一下它的手冊。
> -不過記住: ``indent`` 不能修正壞的編程習慣。
> +``indent`` 有很多選項,特別是重新格式化註解的時候,你可能需要看一下它的手冊。
> +不過記住: ``indent`` 不能修正壞的程式設計習慣。
>
> 請注意,您還可以使用 ``clang-format`` 工具幫助您處理這些規則,快速自動重新格
> -式化部分代碼,並審閱整個文件以發現代碼風格錯誤、打字錯誤和可能的改進。它還可
> -以方便地排序 ``#include`` ,對齊變量/宏,重排文本和其他類似任務。
> +式化部分程式碼,並審閱整個檔案以發現程式碼風格錯誤、打字錯誤和可能的改進。它還可
> +以方便地排序 ``#include`` ,對齊變數/巨集,重排文字和其他類似任務。
> 詳見 Documentation/dev-tools/clang-format.rst 。
[...]
> -分配一個數組的首選形式是這樣的:
> +分配一個陣列的首選形式是這樣的:
>
> .. code-block:: c
>
> - p = kmalloc_array(n, sizeof(...), ...);
> + p = kmalloc_objs(*p, n, ...);
>
> -分配一個零長數組的首選形式是這樣的:
> +分配一個零長陣列的首選形式是這樣的:
>
> .. code-block:: c
>
> - p = kcalloc(n, sizeof(...), ...);
> + p = kzalloc_objs(*p, n, ...);
> +
> +這兩種形式都會檢查分配大小 n * sizeof(...) 是否溢位,如果發生溢位則回傳
> +NULL。
I would say splitting this part into a small patch is better. But for this
time, it's fine.
next prev parent reply other threads:[~2026-07-22 14:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 21:55 [PATCH 00/16] docs/zh_TW: localize terminology and sync process/ documents Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 01/16] docs/zh_TW: process: localize terminology in 7.AdvancedTopics.rst Chen-Yu Yeh
2026-07-22 5:56 ` Weijie Yuan
[not found] ` <amCDyEKqNzkjgu-H@wyuan.org>
2026-07-22 13:32 ` 葉宸佑
2026-07-21 21:55 ` [PATCH 02/16] docs/zh_TW: process: localize terminology in 1.Intro.rst Chen-Yu Yeh
2026-07-22 7:42 ` Weijie Yuan
2026-07-21 21:55 ` [PATCH 03/16] docs/zh_TW: process: localize terminology in code-of-conduct-interpretation.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 04/16] docs/zh_TW: process: localize terminology in license-rules.rst Chen-Yu Yeh
2026-07-22 11:35 ` Weijie Yuan
2026-07-21 21:55 ` [PATCH 05/16] docs/zh_TW: process: localize terminology in email-clients.rst Chen-Yu Yeh
2026-07-22 11:35 ` Weijie Yuan
2026-07-21 21:55 ` [PATCH 06/16] docs/zh_TW: process: localize terminology in programming-language.rst Chen-Yu Yeh
2026-07-22 14:51 ` Weijie Yuan
2026-07-21 21:55 ` [PATCH 07/16] docs/zh_TW: process: localize terminology in coding-style.rst Chen-Yu Yeh
2026-07-22 14:48 ` Weijie Yuan [this message]
2026-07-21 21:55 ` [PATCH 08/16] docs/zh_TW: process: localize terminology in stable-kernel-rules.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 09/16] docs/zh_TW: process: localize terminology in 5.Posting.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 10/16] docs/zh_TW: process: localize terminology in 2.Process.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 11/16] docs/zh_TW: process: localize terminology in howto.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 12/16] docs/zh_TW: process: localize terminology in embargoed-hardware-issues.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 13/16] docs/zh_TW: process: localize terminology in submitting-patches.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 14/16] docs/zh_TW: process: localize terminology in 8.Conclusion.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 15/16] docs/zh_TW: process: localize terminology in index.rst Chen-Yu Yeh
2026-07-21 21:55 ` [PATCH 16/16] docs/zh_TW: Add a glossary for Traditional Chinese translations Chen-Yu Yeh
2026-07-22 15:09 ` [PATCH 00/16] docs/zh_TW: localize terminology and sync process/ documents Weijie Yuan
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=amDYOmUlDWCOCa4M@wyuan.org \
--to=wy@wyuan.org \
--cc=2023002089@link.tyut.edu.cn \
--cc=alexs@kernel.org \
--cc=chenyou910331@gmail.com \
--cc=corbet@lwn.net \
--cc=dzm91@hust.edu.cn \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=si.yanteng@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox