1 // SPDX-License-Identifier: GPL-2.0-only
2 /// Use WARN(1,...) rather than printk followed by WARN_ON(1)
5 // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.
6 // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.
7 // URL: http://coccinelle.lip6.fr/
9 // Options: --no-includes --include-headers
24 @r1 depends on context || report || org@
31 @script:python depends on org@
35 cocci.print_main("printk + WARN_ON can be just WARN",p)
37 @script:python depends on report@
41 msg = "SUGGESTION: printk + WARN_ON can be just WARN"
42 coccilib.report.print_report(p[0],msg)
44 @ok1 depends on patch@
55 expression list ok1.es;
63 // --------------------------------------------------------------------
73 @r2 depends on context || report || org@
80 @script:python depends on org@
84 cocci.print_main("printk + WARN_ON_ONCE can be just WARN_ONCE",p)
86 @script:python depends on report@
90 msg = "SUGGESTION: printk + WARN_ON_ONCE can be just WARN_ONCE"
91 coccilib.report.print_report(p[0],msg)
93 @ok2 depends on patch@
104 expression list ok2.es;