Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3433905pxb; Mon, 4 Apr 2022 16:53:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPK4BlFqhKzINhPm3/x/PhFHdy8FAlhOSDqo42sDGT5Gby/6cmBBF+DdrEp2MBfZE1nkPn X-Received: by 2002:a17:90a:3c84:b0:1ca:56c8:5793 with SMTP id g4-20020a17090a3c8400b001ca56c85793mr804662pjc.226.1649116403483; Mon, 04 Apr 2022 16:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649116403; cv=none; d=google.com; s=arc-20160816; b=O/hRQYPgdh/5rRElWb7vYVifh+7Crzucg6GHXNAd7rJb6hIaXJOBiKHS3n3mNklmvB ATstC4W2ibECh+UR12/Fh+Bdo0hYGD1Fk5j5UPQ8RLmJcUx1zVlN5A5L6lqIptbO8I7k uG8Kw9JfAs1a1m9Uv1p46cajYvaeVmamU+8GzY3+EtBqwDLmL4Vm43vDKH8rVg8PFZpj Wes62G30rmqa6nfCVh0mxc+mgpy5OrcsnJE53gKa41dyFfQT9cI9X90uufj9zaIrp4Tk Fh6tYpo+gFPOCrFfWsYal0djMSOd4R6In6GXmJ6GlD7CWJE0Zsm+A78HBh9/DzgN3CVb EfaQ== 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:date:subject:cc:to:from:dkim-signature; bh=bTzou43pxVjLYjVfIWrVWgWWPdHNH0Ynv/+oDE+Yxkw=; b=uIwvKWW2XOVa3NvkPzqJALcqbwW82gH8OPbhN4+7clmMSmea12C7vbsla7FFvVvNUb Yum1IgR4uToLwWawklXc6fOfDkHm2+96eGWgGYD3Gm9eIKg7fOWquV92cm+ObFytPpD2 RTeOMZkdBqGbUOvc7LnDmJGqvGJ7XpM+gCm8Cl1VDkcSpQmjluVsGPaEOyL6le4O7aQh ZbllbxS54tcrTEp70u+NrRw2T1GEPkk8YUZ+FBD8yPYLRuai0D1OzqQRE8jmkcDegf3O pQ0JrFylxQR3ei5ulzxh+BR5vNYxSsAsfd2VoY1en3DzpgiTln0LhgDI+4TMd8x4eQpd vyfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=C5XDR4jA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id rj2-20020a17090b3e8200b001cab56c62d0si639843pjb.100.2022.04.04.16.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 16:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=C5XDR4jA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F0BF45E16D; Mon, 4 Apr 2022 16:36:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbiDDWru (ORCPT + 99 others); Mon, 4 Apr 2022 18:47:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236347AbiDDWrW (ORCPT ); Mon, 4 Apr 2022 18:47:22 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D20F613CF4 for ; Mon, 4 Apr 2022 14:59:39 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 234LxRla098419; Mon, 4 Apr 2022 16:59:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1649109567; bh=bTzou43pxVjLYjVfIWrVWgWWPdHNH0Ynv/+oDE+Yxkw=; h=From:To:CC:Subject:Date; b=C5XDR4jA/KiWytLZH7xLuLy4XsZpcYPA7/9IDiyu2FRgm/ZwlP+vVhiO0Q18HeOH2 fMPlwMTCiHWc9JAN4DDppXIUgPLNLV/HwlA79TVXyUt5kiWtBxRK8b39z5NdWSE5/O MZ4QBW8QEuVFrgnpIyiS1qgAOAaKiJM4XP0mZemQ= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 234LxRTI070696 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Apr 2022 16:59:27 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 4 Apr 2022 16:59:27 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Mon, 4 Apr 2022 16:59:27 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 234LxRUq009509; Mon, 4 Apr 2022 16:59:27 -0500 From: Nishanth Menon To: Nicolas Palix , Julia Lawall CC: , , Kirill Smelkov , Nishanth Menon Subject: [PATCH] coccinelle: api/stream_open: Introduce metavariables for checks Date: Mon, 4 Apr 2022 16:59:26 -0500 Message-ID: <20220404215926.14811-1-nm@ti.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Coccinelle spatch version 1.1.1 reports the following: warning: line 134: should no_llseek be a metavariable? warning: line 141: should noop_llseek be a metavariable? warning: line 223: should nonseekable_open be a metavariable? warning: line 290: should nonseekable_open be a metavariable? warning: line 338: should nonseekable_open be a metavariable? So, introduce the metavariable similar to other check instances. Signed-off-by: Nishanth Menon --- NOTE: This is currently reported in next-20220404, though I have'nt bisected for exact fixes tags to be used. scripts/coccinelle/api/stream_open.cocci | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/coccinelle/api/stream_open.cocci b/scripts/coccinelle/api/stream_open.cocci index df00d6619b06..d33732f35710 100644 --- a/scripts/coccinelle/api/stream_open.cocci +++ b/scripts/coccinelle/api/stream_open.cocci @@ -129,6 +129,7 @@ identifier llseek_f; @ has_no_llseek @ identifier fops0.fops; +identifier no_llseek; @@ struct file_operations fops = { .llseek = no_llseek, @@ -136,6 +137,7 @@ identifier fops0.fops; @ has_noop_llseek @ identifier fops0.fops; +identifier noop_llseek; @@ struct file_operations fops = { .llseek = noop_llseek, @@ -216,6 +218,7 @@ identifier stream_writer.writestream; @ report_rw depends on report @ identifier fops_rw.openfunc; +identifier nonseekable_open; position p1; @@ openfunc(...) { @@ -283,6 +286,7 @@ identifier stream_reader.readstream; @ report_r depends on report @ identifier fops_r.openfunc; +identifier nonseekable_open; position p1; @@ openfunc(...) { @@ -331,6 +335,7 @@ identifier stream_writer.writestream; @ report_w depends on report @ identifier fops_w.openfunc; +identifier nonseekable_open; position p1; @@ openfunc(...) { -- 2.31.1