Skip to content

Commit 340a4cb

Browse files
avarttaylorr
authored andcommitted
cocci rules: remove <id>'s from rules that don't need them
The <id> in the <rulename> part of the coccinelle syntax[1] is for our purposes there to declares if we have inter-dependencies between different rules. But such <id>'s must be unique within a given semantic patch file. As we'll be processing a concatenated version of our rules in the subsequent commit let's remove these names. They weren't being used for the semantic patches themselves, and equated to a short comment about the rule. Both the filename and context of the rules makes it clear what they're doing, so we're not gaining anything from keeping these. Retaining them goes against recommendations that "contrib/coccinelle/README" will be making in the subsequent commit. This leaves only one named rule in our sources, where it's needed for a "<id> <-> <extends> <id>" relationship: $ git -P grep '^@ ' -- contrib/coccinelle/ contrib/coccinelle/swap.cocci:@ swap @ contrib/coccinelle/swap.cocci:@ extends swap @ 1. https://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar.html Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 202086b commit 340a4cb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

contrib/coccinelle/hashmap.cocci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@ hashmap_entry_init_usage @
1+
@@
22
expression E;
33
struct hashmap_entry HME;
44
@@

contrib/coccinelle/preincr.cocci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@ preincrement @
1+
@@
22
identifier i;
33
@@
44
- ++i > 1

contrib/coccinelle/strbuf.cocci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@ strbuf_addf_with_format_only @
1+
@@
22
expression E;
33
constant fmt !~ "%";
44
@@

contrib/coccinelle/swap.cocci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@ swap_with_declaration @
1+
@@
22
type T;
33
identifier tmp;
44
T a, b;

0 commit comments

Comments
 (0)