]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
ALSA: sound/soc/at32: Useless NULL test
authorJulien Brunel <brunel@diku.dk>
Fri, 26 Sep 2008 13:23:46 +0000 (15:23 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 10 Oct 2008 11:41:40 +0000 (13:41 +0200)
commit71dc525c5d480397ac7343a0a2808f8a23705d42
tree10395716d38a5a742d7071b4efc8f18819e9e464
parent9a9e2359f484402c620f9a3748037fea65fa5af4
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/)

// <smpl>
@bad_null_test@
expression x,E;
@@
x = ssc_request(...)
... when != x = E
* x != NULL
// </smpl>

Signed-off-by: Julien Brunel <brunel@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/at32/playpaq_wm8510.c