Hi!

        In my current project, I moved a field from a structure
(struct block) into another network-endian structure.  I used the
following patch.cocci to do the fixups:

        @ rule1 @
        struct block *b;
        @@
        
        - b->blocknum
        + le32_to_cpu(b->hdr->depth)

It got 99%, but it missed the two cases where b was actually in another
structure, ie. "te->block->blocknum".

I *think* this is because I want to substitute any expression of type
struct block *, rather than only identifiers?

But I couldn't understand the documentation enough to do this :(

Clues appreciated!
Rusty.
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to