coccinelle: api/stream_open: Introduce metavariables for checks
PATCH v2 1/1 coccinelle: api/stream_open: Introduce metavariables for checks
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 <[email protected]>
---
based on: next-20220404
Changes since V1:
* Switch from identifier to more specific symbol
V1: https://lore.kernel.org/all/[email protected]/
scripts/coccinelle/api/stream_open.cocci | 5 +++++ 1 file changed, 5 insertions(+)
scripts/coccinelle/api/stream_open.cocci +5 -0
@@ -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(...) {
Signature · 1 line
2.31.1