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_on_off() replacements

As other rules done, we add rules for str_on_off()
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
9b5b4810 c81ca023

+19
+19
scripts/coccinelle/api/string_choices.cocci
··· 279 279 @@ 280 280 281 281 coccilib.report.print_report(p[0], "opportunity for str_write_read(%s)" % e) 282 + 283 + @str_on_off depends on patch@ 284 + expression E; 285 + @@ 286 + - ((E) ? "on" : "off") 287 + + str_on_off(E) 288 + 289 + @str_on_off_r depends on !patch exists@ 290 + expression E; 291 + position P; 292 + @@ 293 + * ((E@P) ? "on" : "off") 294 + 295 + @script:python depends on report@ 296 + p << str_on_off_r.P; 297 + e << str_on_off_r.E; 298 + @@ 299 + 300 + coccilib.report.print_report(p[0], "opportunity for str_on_off(%s)" % e)