aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <[email protected]>2022-07-11 16:42:43 -0400
committerJulia Lawall <[email protected]>2022-07-16 15:31:33 +0200
commit8e54fe1b0f03a89925925ed98acd2219e0c956d4 (patch)
treed639f8bde308b8509ded4c67a813b20e8ec326a5 /scripts
parent38857318692acd02353b47129bb06326528a47c0 (diff)
coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool
There is nothing wrong with current code that returns 0 or 1 for a function returning bool. It is perfectly acceptable by the C standard. To avoid churn of unwanted patches that are constantly sent to maintainers who do not care about this change, remove the script that flags it as an issue. This issue is not worth the burden on maintainers to accept useless patches. Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/190b5c2f2f2fb9cc775fce8daed72bf893be48a4.1642065293.git.davidcomponentone@gmail.com/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Cc: Rasmus Villemoes <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Michal Marek <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]> Signed-off-by: Julia Lawall <[email protected]> Acked-by: Rasmus Villemoes <[email protected]> Acked-by: Paul Gortmaker <[email protected]>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/misc/boolreturn.cocci59
1 files changed, 0 insertions, 59 deletions
diff --git a/scripts/coccinelle/misc/boolreturn.cocci b/scripts/coccinelle/misc/boolreturn.cocci
deleted file mode 100644
index 29d2bf41e95d..000000000000
--- a/scripts/coccinelle/misc/boolreturn.cocci
+++ /dev/null
@@ -1,59 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/// Return statements in functions returning bool should use
-/// true/false instead of 1/0.
-//
-// Confidence: High
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual report
-virtual context
-
-@r1 depends on patch@
-identifier fn;
-typedef bool;
-symbol false;
-symbol true;
-@@
-
-bool fn ( ... )
-{
-<...
-return
-(
-- 0
-+ false
-|
-- 1
-+ true
-)
- ;
-...>
-}
-
-@r2 depends on report || context@
-identifier fn;
-position p;
-@@
-
-bool fn ( ... )
-{
-<...
-return
-(
-* 0@p
-|
-* 1@p
-)
- ;
-...>
-}
-
-
-@script:python depends on report@
-p << r2.p;
-fn << r2.fn;
-@@
-
-msg = "WARNING: return of 0/1 in function '%s' with return type bool" % fn
-coccilib.report.print_report(p[0], msg)