From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Julia Lawall <Julia.Lawall@lip6.fr>,
Michal Marek <mmarek@suse.cz>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool
Date: Mon, 11 Jul 2022 18:11:18 -0400 [thread overview]
Message-ID: <20220711221118.GA22897@windriver.com> (raw)
In-Reply-To: <20220711164243.092eec75@gandalf.local.home>
[[PATCH] coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool] On 11/07/2022 (Mon 16:42) Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> 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.
This is long overdue. Our maintainers are a finite resource and if we
can't even take basic steps to filter them from ground level noise, then
we are letting them down, and then eventually suffering the consequences.
I've watched far too many of these go by on lkml and thought "oh look,
there goes another one". Not ideal.
I don't think I've ever Ack'd a patch I've not been Cc'd on but this is
different. It isn't about me -- it is about what we've all seen on lkml.
So...
Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Paul.
--
>
> Link: https://lore.kernel.org/all/20220705073822.7276-1-jiapeng.chong@linux.alibaba.com/
> Link: https://lore.kernel.org/all/20220429075201.68581-1-jiapeng.chong@linux.alibaba.com/
> Link: https://lore.kernel.org/all/1649236467-29390-1-git-send-email-baihaowen@meizu.com/
> Link: https://lore.kernel.org/all/20220317014740.3138-1-jiapeng.chong@linux.alibaba.com/
> Link: https://lore.kernel.org/all/190b5c2f2f2fb9cc775fce8daed72bf893be48a4.1642065293.git.davidcomponentone@gmail.com/
> Link: https://lore.kernel.org/all/20211214113845.439392-1-deng.changcheng@zte.com.cn/
> Link: https://lore.kernel.org/all/20210824065735.60660-1-deng.changcheng@zte.com.cn/
> Link: https://lore.kernel.org/all/20210824064305.60081-1-deng.changcheng@zte.com.cn/
> Link: https://lore.kernel.org/all/20210824062359.59474-1-deng.changcheng@zte.com.cn/
>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Cc: Julia Lawall <Julia.Lawall@lip6.fr>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> scripts/coccinelle/misc/boolreturn.cocci | 59 ------------------------
> 1 file changed, 59 deletions(-)
> delete mode 100644 scripts/coccinelle/misc/boolreturn.cocci
>
> 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)
> --
> 2.35.1
>
next prev parent reply other threads:[~2022-07-11 22:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 20:42 [PATCH] coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool Steven Rostedt
2022-07-11 22:11 ` Paul Gortmaker [this message]
2022-07-14 17:39 ` Julia Lawall
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=20220711221118.GA22897@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=Julia.Lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mmarek@suse.cz \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/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