Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp951115pxb; Wed, 6 Apr 2022 05:09:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcDaR4qXymn9fvkebhbUqGnBD99jNXyILHBH9gEIZ0XA20Av/xZo6vr+uzBaA3NZEthFDy X-Received: by 2002:a63:ec47:0:b0:382:692a:dc04 with SMTP id r7-20020a63ec47000000b00382692adc04mr6846510pgj.352.1649246957858; Wed, 06 Apr 2022 05:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246957; cv=none; d=google.com; s=arc-20160816; b=P43ojJAajLRB7RoENzTgiQsLyZxU/5R40QtfAdvzRBWdh7lUhxL/+wLVcO3pdIVsqH g2jSTSXh3iowwDPJvbF2FcYkbOk9bLIROxthenmUcITEqLmIrFQNf4xs5E6QgYJMuHXV b0nfShI7F9eK+3VdXmFecvwPPt2CwviwV1IsG4upFRH23s9vofonODeenv1QK6os7hI2 LVGFdAGppeJFn0Isn8DxlHUdZYRTQJK9fB70YdLncl1CnNzKGkKscrZqpPLvr4eEhrye 0VtXdNDHjJ+6GZIpZUn4UQCcffNiKBe2sSG+qZ+Sqm1RLLLxBjXSDP6MDP9UeL6Xb97t T0Pw== 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=/OV5EIXkyfTUEfMK+NbO/uRsTKu3O0KPAyqpHSHxqVY=; b=cN3e/PgYZuOfpLie2qzpfe3oCKl21l3dQQlJbPpBu2OGqM8ymq55Jh1LOlu7zExtNl 3oypYjMN0mCgJGdNbbp1tzcCKoQRMhePA3mPrbzT/bNNsr1aSSvvh3lJWYcYh7ZdtEZL 9i6QzYaCrMf526RYusan+3oROKulTJBKeHrWt1YvnRfZP1cWpkWp+T6RwurhYRv7ru3+ CvHaG8U10ANIiC3FGpLI7DbISKXprT2+KNcH9HUEdf9BeT2PmLiXX8PMgFFAI6DCBbZa QUBEnMbU/denWlq59Re1kTYlLndHDnZbhn0MLEbkVkvclz9u5nQWYYeQGlLpFdPq4Mdi /g9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=rBhAQvK+; 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 g15-20020a170902d5cf00b00153b2d165c1si14757445plh.457.2022.04.06.05.09.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:09:17 -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=rBhAQvK+; 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 236BF4FA7AC; Wed, 6 Apr 2022 03:41:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1578712AbiDEXYm (ORCPT + 99 others); Tue, 5 Apr 2022 19:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389627AbiDENeE (ORCPT ); Tue, 5 Apr 2022 09:34:04 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E15137022 for ; Tue, 5 Apr 2022 05:39:47 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 235CdbGR027079; Tue, 5 Apr 2022 07:39:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1649162377; bh=/OV5EIXkyfTUEfMK+NbO/uRsTKu3O0KPAyqpHSHxqVY=; h=From:To:CC:Subject:Date; b=rBhAQvK+jG6gu6yh+a7D4lygUBpzbeisNCiBjy3MNPUnwXIrHof24o1aJMlicO6tc P58OgNH+HBMBItFGCTa1Mo1RTPG/vdjiUMWMY0sNLaFoWxatW0qG7oxjQkmOJHPtzB 8DSsfUVYO1E4JjPYVAV2pwlcCnQ3Wj/Yx0n0cHPQ= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 235CdbAo035535 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 Apr 2022 07:39:37 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 5 Apr 2022 07:39:37 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE100.ent.ti.com (10.64.6.21) 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; Tue, 5 Apr 2022 07:39:37 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 235CdbEr112656; Tue, 5 Apr 2022 07:39:37 -0500 From: Nishanth Menon To: Nicolas Palix , Julia Lawall CC: , , Kirill Smelkov , Nishanth Menon Subject: [PATCH V2] coccinelle: api/stream_open: Introduce metavariables for checks Date: Tue, 5 Apr 2022 07:39:36 -0500 Message-ID: <20220405123936.30259-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 these as symbols to be specific C identifier to match. Signed-off-by: Nishanth Menon --- based on: next-20220404 Changes since V1: * Switch from identifier to more specific symbol V1: https://lore.kernel.org/all/20220404215926.14811-1-nm@ti.com/ 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; +symbol no_llseek; @@ struct file_operations fops = { .llseek = no_llseek, @@ -136,6 +137,7 @@ identifier fops0.fops; @ has_noop_llseek @ identifier fops0.fops; +symbol 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; +symbol nonseekable_open; position p1; @@ openfunc(...) { @@ -283,6 +286,7 @@ identifier stream_reader.readstream; @ report_r depends on report @ identifier fops_r.openfunc; +symbol nonseekable_open; position p1; @@ openfunc(...) { @@ -331,6 +335,7 @@ identifier stream_writer.writestream; @ report_w depends on report @ identifier fops_w.openfunc; +symbol nonseekable_open; position p1; @@ openfunc(...) { -- 2.31.1