From: Julia Lawall Date: Sun, 29 Dec 2013 22:47:36 +0000 (+0100) Subject: fujitsu-laptop: fix error return code X-Git-Tag: v3.14-rc1~54^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b30bb89f0fb29502f573d01419391a1e2a4cc4f1;p=pandora-kernel.git fujitsu-laptop: fix error return code These functions mix the use of result and error. In acpi_fujitsu_add, result does not seem useful; it would seem reasonable to propagate the return value of acpi_bus_update_power in an error case. On the other hand, in the case of acpi_fujitsu_hotkey_add, there is an initialization of result that can lead to what looks like a failure case, but that does not abort the function. The variable result is kept for this case. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall Signed-off-by: Matthew Garrett --- Reading git-diff-tree failed