Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3689147imw; Mon, 11 Jul 2022 13:45:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uI/z+1eteuVi2BuCmfC2CmgV4ru2yKZXDZAjAtjExCQRUk7DFYvOUIyZyFz/w8khT9Z72J X-Received: by 2002:a05:6402:50d2:b0:43a:8487:8a09 with SMTP id h18-20020a05640250d200b0043a84878a09mr27422143edb.232.1657572313608; Mon, 11 Jul 2022 13:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657572313; cv=none; d=google.com; s=arc-20160816; b=jlOCp66dlOwVnOVslycHq3KJCfTzCF8XDgeF2zXq8ljYKPLVQnD8GSeYGnkOENNKpn nVeMb97QdfDXAN9NbK34RdUcCuzO8+ADqWwsnEgeqqQOyO6XgglUq/Z3fZJHhkj5+43A xpHRoqkNiwEW/g99Yg+tRPaVyKstjECxLjvGtGnKlVYfeJalNSyj4ANhUs+BsVqazHfU waxz8stjyUxAYMK8JHOToGuVbYfdp9MIx2q9IT7PUMmidkT96kSyweGsMZXw9l5Q0z5o bQk7wfSA+IzfsU9QIeVcJad8myvN8GoyXwGWlGajELvtIAGBpfWyobexQtMdAX/OZeCH /Crg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date; bh=PWKW+MxJKVvFl+4D8IDL03UK2CuquxI3kTcshU7QAvA=; b=LfeEcjT50gvI2k/M1BgyWB+cBLy10RBGIzwzS14VZt9BCjgvS4/2OqIzVGSfDMqLJ1 XjTXinV82mKXf9JhIvCvJRt/j8DM9S+eE5Guig87quP5HOWIlkSIkc24riboU2DgmGc1 L4e/wjXX4HVFq8OeKRCfiM7ucEJ83bgSeMlhRjIC/xSW3Thk9IZ8XFfbKWd3g1ijrBrh hMq0MnIKzNfUOvunE8Ls0bIhGllP5mwGAFPqc1fF8AqNTyli12N2e12Tnnin9j6LilfS yo9xC2Td63AtMXjtu5eEz9AHwHl+HfHaVKHrQUQLcmROqAMJ3M+JF9yXb91Whgs5RPRB nH1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq16-20020a1709073f1000b0072b4f140c57si8920870ejc.592.2022.07.11.13.44.48; Mon, 11 Jul 2022 13:45:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231591AbiGKUmv (ORCPT + 99 others); Mon, 11 Jul 2022 16:42:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbiGKUmt (ORCPT ); Mon, 11 Jul 2022 16:42:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BD00774B0 for ; Mon, 11 Jul 2022 13:42:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 48C23B81203 for ; Mon, 11 Jul 2022 20:42:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58CFAC34115; Mon, 11 Jul 2022 20:42:45 +0000 (UTC) Date: Mon, 11 Jul 2022 16:42:43 -0400 From: Steven Rostedt To: LKML Cc: Rasmus Villemoes , Julia Lawall , Michal Marek , Peter Zijlstra Subject: [PATCH] coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool Message-ID: <20220711164243.092eec75@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (Google)" 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/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 Cc: Julia Lawall Cc: Michal Marek Cc: Peter Zijlstra Signed-off-by: Steven Rostedt (Google) --- 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