From: Julien Brunel Date: Fri, 26 Sep 2008 13:23:46 +0000 (+0200) Subject: ALSA: sound/soc/at32: Useless NULL test X-Git-Tag: v2.6.28-rc1~720^2~22 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71dc525c5d480397ac7343a0a2808f8a23705d42;p=pandora-kernel.git ALSA: sound/soc/at32: Useless NULL test The test (ssc != NULL) can only be reached if the call to the function ssc_request, the result of which ssc is assigned, succeeds. Moreover, two statements assign NULL to ssc just before a return, which is useless since it is a local variable. So, we suggest to delete the test and the two assignments. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @bad_null_test@ expression x,E; @@ x = ssc_request(...) ... when != x = E * x != NULL // Signed-off-by: Julien Brunel Signed-off-by: Julia Lawall Acked-by: Mark Brown Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- Reading git-diff-tree failed