coccicheck: Add unneeded return variable test
authorPeter Senna Tschudin <peter.senna@gmail.com>
Sun, 1 Jun 2014 18:12:31 +0000 (15:12 -0300)
committerMichal Marek <mmarek@suse.cz>
Tue, 10 Jun 2014 12:36:30 +0000 (14:36 +0200)
commit90829adb4a8ea3b007bd8c63f5b54fddb7972bec
treee152dd1c1c60a91dd339913ee5f9793fe887f7e2
parent4be7f0a30bd85c82278ffd65527b5276ffa23fff
coccicheck: Add unneeded return variable test

This semantic patch looks for variables that are initialized with a
constant, are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/coccinelle/misc/returnvar.cocci [new file with mode: 0644]