Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp804099rwl; Sun, 25 Dec 2022 07:29:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXvX49a2NOZvLLtGlm9W62iyRz63y+MmE5YlsQQ9SgCWeYnFYkR1/S8cpgcCI9iao5SksiLg X-Received: by 2002:aa7:d855:0:b0:483:2ade:2414 with SMTP id f21-20020aa7d855000000b004832ade2414mr4634628eds.16.1671982178954; Sun, 25 Dec 2022 07:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671982178; cv=none; d=google.com; s=arc-20160816; b=duI5sDaYosUoSe7MuyEruU4jYxnh5ecB4MTbn0pAaUYPfNBasZD938sJb5VM+TWFqN j+I6Yc7HIZQottCun/FvhPhRrqdG+xW4JK4s7J4szrbftLyYyoFjfQB8MIJOEKkssbcp Syztd9FhP51/ovrWSE3qvWQW2u6eiHtt+y9jT6T6ToxPoH9p+82nhwEhczO/RMwRcbsW XVzofvNxBnUVweIucJZEBXCtWtaLTECEkUnCbdsZuSH7uStih5/aDocu5Fo8RAJP7g6H ZAU2X6tWzzR4Ol9AJucBbwE5ZElTkfY27LxnmeA2JsMLvTuIWeVLTOS2JRIUoaEk+vlp vXzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=6UfeXhqBPhCnzAVep7pncTrLl2H4zeiceXIx+IefpL4=; b=E4MDjRzTUlBcrj8FLfV+RvLltjUEaKaegF/xrm6nbBp4rY5KPQJ1qjmvrXU8TpIOL9 yKjSSSj+bwpZ6oq/AhuLJtmErPjwGcD1LAM8pe1GRslwt0LAOYEKb3znr+YxNMPKzvYC OWRxDs1pZpZ4mg+MC/Li21G67SbKWEDIkE+mcVWw/i7zTlLZy48utTh6uT866Uixed+z DWXi/jYrBGkNytO7J/juvML3k6gvI7cX4Z4LuFz4sGcIcR5/QhUqFXvigzU/xXuXozpn CdQaMIbeGqn33SI7TNII6tTazpfOPf0ThZ4kQDVG4MSmwLKOnUaMhxrvUSbtdxqRAYZY cqaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=BV5vHNAV; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a50fd8a000000b00482cea2547csi4092818edt.197.2022.12.25.07.29.22; Sun, 25 Dec 2022 07:29:38 -0800 (PST) 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; dkim=fail header.i=@mailo.com header.s=mailo header.b=BV5vHNAV; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbiLYPJi (ORCPT + 66 others); Sun, 25 Dec 2022 10:09:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiLYPJh (ORCPT ); Sun, 25 Dec 2022 10:09:37 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 938695FE3 for ; Sun, 25 Dec 2022 07:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1671980971; bh=JbAethzpN7nG0wyvMkJzQiQv8OlJxBl91l6miBYz0Nk=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=BV5vHNAVx1e/43nCEdOqcUs8eTIfHoxAmmzp+gTIUGqHpE7l3InpEvyE80hfV0PwH aqr41iwS2IbMlBJvwNsVPBakz+BVHTX3CE1KYyBj2H+D0Eqzau/k+T2Br5vGIG56VR IhsZz+L3okJuaOW0pPOONVbgbrfcjiMd6ej8yReY= Received: by b-4.in.mailobj.net [192.168.90.14] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 25 Dec 2022 16:09:31 +0100 (CET) X-EA-Auth: Grnebmk61o2Ytl3xXoo8eI+B/Z+hTR6IkbcdeL7dstezlgCqOfUiYXf7/B+fI6UnsFS+ceP+79I10fP+LlSD+n417BF7f6Ck Date: Sun, 25 Dec 2022 20:39:25 +0530 From: Deepak R Varma To: Julia Lawall , Nicolas Palix , cocci@inria.fr, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , Deepak R Varma Subject: [PATCH] coccinelle: api/atomic_as_refcounter: include message type in output Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 A common practice is to grep for "WARNING" or "ERROR" text in the report output from a coccinelle semantic patch script. So, include the test "WARNING: " in the report output generated by the semantic patch for desired filtering of the output. Also improves the readability of the output. Here is an example of the old and new outputs reported: xyz_file.c:131:39-40: atomic_add_unless xyz_file.c:131:39-40: WARNING: atomic_add_unless xyz_file.c:196:6-25: atomic_dec_and_test variation before object free at line 208. xyz_file.c:196:6-25: WARNING: atomic_dec_and_test variation before object free at line 208. Signed-off-by: Deepak R Varma --- scripts/coccinelle/api/atomic_as_refcounter.cocci | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci index e63d52408b86..bbe5b2932933 100644 --- a/scripts/coccinelle/api/atomic_as_refcounter.cocci +++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci @@ -55,7 +55,7 @@ identifier fname6 =~ ".*call_rcu.*"; p1 << r1.p1; p2 << r1.p2; @@ -msg = "atomic_dec_and_test variation before object free at line %s." +msg = "WARNING: atomic_dec_and_test variation before object free at line %s." coccilib.report.print_report(p1[0], msg % (p2[0].line)) @r4 exists@ @@ -88,7 +88,7 @@ fname@p2(y, ...); p1 << r4.p1; p2 << r4.p2; @@ -msg = "atomic_dec_and_test variation before object free at line %s." +msg = "WARNING: atomic_dec_and_test variation before object free at line %s." coccilib.report.print_report(p1[0], msg % (p2[0].line)) @r2 exists@ @@ -107,7 +107,7 @@ atomic64_add_unless(&(a)->x,-1,1)@p1 @script:python depends on report@ p1 << r2.p1; @@ -msg = "atomic_add_unless" +msg = "WARNING: atomic_add_unless" coccilib.report.print_report(p1[0], msg) @r3 exists@ @@ -126,5 +126,5 @@ x = atomic64_add_return@p1(-1, ...); @script:python depends on report@ p1 << r3.p1; @@ -msg = "x = atomic_add_return(-1, ...)" +msg = "WARNING: x = atomic_add_return(-1, ...)" coccilib.report.print_report(p1[0], msg) -- 2.34.1