1 // SPDX-License-Identifier: GPL-2.0-only
3 /// Remove unneeded variable used to store return value.
5 // Confidence: Moderate
6 // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6.
7 // URL: http://coccinelle.lip6.fr/
8 // Comments: Comments on code can be deleted if near code that is removed.
9 // "when strict" can be removed to get more hits, but adds false
11 // Options: --no-includes --include-headers
41 @r1 depends on report || org@
52 @script:python depends on report@
58 coccilib.report.print_report(p1[0], "Unneeded variable: \"" + ret + "\". Return \"" + C + "\" on line " + p2[0].line)
60 @script:python depends on org@
66 cocci.print_main("unneeded \"" + ret + "\" variable", p1)
67 cocci.print_sec("return " + C + " here", p2)