]> rtime.felk.cvut.cz Git - linux-imx.git/commit
mtd: spear_smi: failure test for null rather than negative integer
authorJulia Lawall <Julia.Lawall@lip6.fr>
Wed, 11 Jul 2012 08:58:38 +0000 (10:58 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 29 Sep 2012 13:53:21 +0000 (14:53 +0100)
commitb5170978b421222ba4c3d64d1ebd4a03d64ae42e
tree201a5dcc603699dab3bfceafad316378997e19c9
parent9c6f62a7ef230253a7dfc0547c431f07d8a64721
mtd: spear_smi: failure test for null rather than negative integer

dev_get_platdata returns a pointer, so the failure value would be NULL
rather than a negative integer.

The semantic match that finds this problem is: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,e;
statement S1,S2;
@@

*x = dev_get_platdata(...)
... when != x = e
*if (x < 0) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/spear_smi.c