History

coccinelle: misc: update uninitialized_var.cocci documentation

Remove the documentation link from the warning message because commit 3942ea7a10c9 ("deprecated.rst: Remove now removed uninitialized_var") removed the section from documentation. Update the rule documentation accordingly.

Denis Efremov committed 5 years ago

Commit cb627321 parent 3afb5321 file · +10 −5Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/coccinelle/misc/uninitialized_var.cocci+10−5
@@ -1,7 +1,9 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 ///
33 /// Please, don't reintroduce uninitialized_var().
4−/// From Documentation/process/deprecated.rst:
4+///
5+/// From Documentation/process/deprecated.rst,
6+/// commit 4b19bec97c88 ("docs: deprecated.rst: Add uninitialized_var()"):
57 /// For any compiler warnings about uninitialized variables, just add
68 /// an initializer. Using warning-silencing tricks is dangerous as it
79 /// papers over real bugs (or can in the future), and suppresses unrelated
@@ -11,6 +13,11 @@ · 3 unmodified lines
1113 /// obviously redundant, the compiler's dead-store elimination pass will make
1214 /// sure there are no needless variable writes.
1315 ///
16+/// Later, commit 3942ea7a10c9 ("deprecated.rst: Remove now removed
17+/// uninitialized_var") removed this section because all initializations of
18+/// this kind were cleaned-up from the kernel. This cocci rule checks that
19+/// the macro is not explicitly or implicitly reintroduced.
20+///
1421 // Confidence: High
1522 // Copyright: (C) 2020 Denis Efremov ISPRAS
1623 // Options: --no-includes --include-headers
@@ -40,12 +47,10 @@ position p; · 23 unmodified lines
4047 p << r.p;
4148 @@
4249
43−coccilib.report.print_report(p[0],
44− "WARNING this kind of initialization is deprecated (https://www.kernel.org/doc/html/latest/process/deprecated.html#uninitialized-var)")
50+coccilib.report.print_report(p[0], "WARNING this kind of initialization is deprecated")
4551
4652 @script:python depends on org@
4753 p << r.p;
4854 @@
4955
50−coccilib.org.print_todo(p[0],
51− "WARNING this kind of initialization is deprecated (https://www.kernel.org/doc/html/latest/process/deprecated.html#uninitialized-var)")
56+coccilib.org.print_todo(p[0], "WARNING this kind of initialization is deprecated")