Tag: 3a8ca95e9d62980fd3b41165ec05032c63ce21da

drivers/misc: elide a non-zero test on a result that is never 0

Author: Julia Lawall <julia@diku.dk> The function thermal_cooling_device_register always returns either a valid pointer or a value made with ERR_PTR, so a test for non-zero on the result will always succeed. The problem was found using the following semantic match. (http://www.emn.fr/x-info/coccinelle/) // @a@ expression E, E1; statement S,S1; position p; @@ E = thermal_cooling_device_register(…) … when …

Continue reading