Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

authored by

Denis Efremov and committed by
Julia Lawall
cb62732d 3afb532b

+10 -5
+10 -5
scripts/coccinelle/misc/uninitialized_var.cocci
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /// 3 3 /// 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()"): 5 7 /// For any compiler warnings about uninitialized variables, just add 6 8 /// an initializer. Using warning-silencing tricks is dangerous as it 7 9 /// papers over real bugs (or can in the future), and suppresses unrelated ··· 12 10 /// changes. Keep in mind that in most cases, if an initialization is 13 11 /// obviously redundant, the compiler's dead-store elimination pass will make 14 12 /// sure there are no needless variable writes. 13 + /// 14 + /// Later, commit 3942ea7a10c9 ("deprecated.rst: Remove now removed 15 + /// uninitialized_var") removed this section because all initializations of 16 + /// this kind were cleaned-up from the kernel. This cocci rule checks that 17 + /// the macro is not explicitly or implicitly reintroduced. 15 18 /// 16 19 // Confidence: High 17 20 // Copyright: (C) 2020 Denis Efremov ISPRAS ··· 47 40 p << r.p; 48 41 @@ 49 42 50 - coccilib.report.print_report(p[0], 51 - "WARNING this kind of initialization is deprecated (https://www.kernel.org/doc/html/latest/process/deprecated.html#uninitialized-var)") 43 + coccilib.report.print_report(p[0], "WARNING this kind of initialization is deprecated") 52 44 53 45 @script:python depends on org@ 54 46 p << r.p; 55 47 @@ 56 48 57 - coccilib.org.print_todo(p[0], 58 - "WARNING this kind of initialization is deprecated (https://www.kernel.org/doc/html/latest/process/deprecated.html#uninitialized-var)") 49 + coccilib.org.print_todo(p[0], "WARNING this kind of initialization is deprecated")