Re: [cocci] Matching objects as well as pointers to objects?
Markus Elfring <[email protected]>
| Newsgroups | fr.inria.cocci |
|---|---|
| Message-ID | <[email protected]> |
> Both cases are equivalent at the C code level.
I suggest to reconsider this view.
Different access operators are involved.
> Can Coccinelle recognize this kind of equivalence
Which kind of pattern recognition would you find more convenient here?
> and is there a way to match both cases with a single patch?
The SmPL code can be refined.
@replacement@
expression bio, errno;
@@
(
-bio.bi_status = errno_to_blk_status(errno);
-bio_endio
+bio_endio_errno
(&bio
+ , errno
);
|
-bio->bi_status = errno_to_blk_status(errno);
-bio_endio
+bio_endio_errno
(bio
+ , errno
);
)
Regards,
Markus