| // SPDX-License-Identifier: GPL-2.0-only |
| /// Use WARN(1,...) rather than printk followed by WARN_ON(1) |
| // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. |
| // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. |
| // URL: https://coccinelle.gitlabpages.inria.fr/website |
| // Options: --no-includes --include-headers |
| @r1 depends on context || report || org@ |
| @script:python depends on org@ |
| cocci.print_main("printk + WARN_ON can be just WARN",p) |
| @script:python depends on report@ |
| msg = "SUGGESTION: printk + WARN_ON can be just WARN" |
| coccilib.report.print_report(p[0],msg) |
| // -------------------------------------------------------------------- |
| @r2 depends on context || report || org@ |
| @script:python depends on org@ |
| cocci.print_main("printk + WARN_ON_ONCE can be just WARN_ONCE",p) |
| @script:python depends on report@ |
| msg = "SUGGESTION: printk + WARN_ON_ONCE can be just WARN_ONCE" |
| coccilib.report.print_report(p[0],msg) |