]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: submitting-patches: Explain race conditions caused by calculations in macros
authorGui-Dong Han <hanguidong02@gmail.com>
Tue, 2 Dec 2025 17:55:36 +0000 (01:55 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 31 Jan 2026 15:38:30 +0000 (07:38 -0800)
commitd0a0960602f780362ea974c80650d87bcf13726a
treee7119aa2ee3bfcf434516a1a9ce71a6b29cec061
parent615901b57b7ef8eb655f71358f7e956e42bcd16b
hwmon: submitting-patches: Explain race conditions caused by calculations in macros

The current documentation advises against calculations in macros
primarily to avoid code obfuscation. It misses the risk of concurrency
issues.

Add a note explaining that macros evaluating arguments multiple times
can lead to race conditions when accessing shared data.

Link: https://lore.kernel.org/all/CALbr=LYJ_ehtp53HXEVkSpYoub+XYSTU8Rg=o1xxMJ8=5z8B-g@mail.gmail.com/
Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
Link: https://lore.kernel.org/r/20251202175536.12774-1-hanguidong02@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/submitting-patches.rst