From: Nishanth Menon <nm@ti.com>
To: Nicolas Palix <nicolas.palix@imag.fr>,
Julia Lawall <Julia.Lawall@inria.fr>
Cc: <linux-kernel@vger.kernel.org>, <cocci@inria.fr>,
Kirill Smelkov <kirr@nexedi.com>, Nishanth Menon <nm@ti.com>
Subject: [PATCH V2] coccinelle: api/stream_open: Introduce metavariables for checks
Date: Tue, 5 Apr 2022 07:39:36 -0500 [thread overview]
Message-ID: <20220405123936.30259-1-nm@ti.com> (raw)
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 <nm@ti.com>
---
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
reply other threads:[~2022-04-05 23:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220405123936.30259-1-nm@ti.com \
--to=nm@ti.com \
--cc=Julia.Lawall@inria.fr \
--cc=cocci@inria.fr \
--cc=kirr@nexedi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.palix@imag.fr \
/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