> That is quite normal.  One statement should be followed by another statement.

I have tried another script variant out for the semantic patch language.


@display@
expression e;
@@
*brelse(e);
 <+... when != e = ...
*e
 ...+>


I wonder about the generation of a diff hunk then like the following.

elfring@Sonne:~/Projekte/Linux/next-patched> spatch 
~/Projekte/Coccinelle/janitor/show_questionable_brelse_usage8.cocci 
fs/ext4/extents.c
…
@@ -1127,8 +1121,6 @@ static int ext4_ext_split(handle_t *hand
        err = ext4_handle_dirty_metadata(handle, inode, bh);
        if (err)
                goto cleanup;
-       brelse(bh);
-       bh = NULL;

        /* correct old leaf */
        if (m) {
 …


Would you like to suggest any fine-tuning for the search approach?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to