lkml.org 
[lkml]   [2012]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
Date
On Wednesday 11 July 2012 10:58:38 Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> 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>

Thanks,
Stefan


\
 
 \ /
  Last update: 2012-07-16 12:21    [from the cache]
©2003-2011 Jasper Spaans