Skip to content

Commit cddd68a

Browse files
avargitster
authored andcommitted
cocci: avoid "should ... be a metavariable" warnings
Since [1] running "make coccicheck" has resulted in [2] being emitted to the *.log files for the "spatch" run, and in the case of "make coccicheck-test" we'd emit these to the user's terminal. Nothing was broken as a result, but let's refactor the relevant rules to eliminate the ambiguity between a possible variable and an identifier. 1. 0e6550a (cocci: add a index-compatibility.pending.cocci, 2022-11-19) 2. warning: line 257: should active_cache be a metavariable? warning: line 260: should active_cache_changed be a metavariable? warning: line 263: should active_cache_tree be a metavariable? warning: line 271: should active_nr be a metavariable? Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07047d6 commit cddd68a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

contrib/coccinelle/index-compatibility.cocci

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
// the_index.* variables
22
@@
3+
identifier AC = active_cache;
4+
identifier ACC = active_cache_changed;
5+
identifier ACT = active_cache_tree;
36
@@
47
(
5-
- active_cache
8+
- AC
69
+ the_index.cache
710
|
8-
- active_cache_changed
11+
- ACC
912
+ the_index.cache_changed
1013
|
11-
- active_cache_tree
14+
- ACT
1215
+ the_index.cache_tree
1316
)
1417

1518
@@
19+
identifier AN = active_nr;
1620
identifier f != prepare_to_commit;
1721
@@
1822
f(...) {<...
19-
- active_nr
23+
- AN
2024
+ the_index.cache_nr
2125
...>}
2226

0 commit comments

Comments
 (0)