Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coccinelle: Add rules to find str_write_read() replacements

As other rules done, we add rules for str_write_read()
to check the relative opportunities.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

authored by

Hongbo Li and committed by
Julia Lawall
c81ca023 ba4b514a

+19
+19
scripts/coccinelle/api/string_choices.cocci
··· 260 260 @@ 261 261 262 262 coccilib.report.print_report(p[0], "opportunity for str_read_write(%s)" % e) 263 + 264 + @str_write_read depends on patch@ 265 + expression E; 266 + @@ 267 + - ((E) ? "write" : "read") 268 + + str_write_read(E) 269 + 270 + @str_write_read_r depends on !patch exists@ 271 + expression E; 272 + position P; 273 + @@ 274 + * ((E@P) ? "write" : "read") 275 + 276 + @script:python depends on report@ 277 + p << str_write_read_r.P; 278 + e << str_write_read_r.E; 279 + @@ 280 + 281 + coccilib.report.print_report(p[0], "opportunity for str_write_read(%s)" % e)