Julia Lawall ba6c4033b9 drivers/rtc: correct an error test
rtc is clearly does not satisfy IS_ERR at the point where it is tested, so
I have changed the test to consider the just initialized rtc->rtc_dev.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@match exists@
expression x, E;
identifier fld;
position p1,p2;
@@

(
x = E;
|
x = E
|
x@p1->fld
... when != x = E
IS_ERR(x@p2)
... when any
)

@other_match exists@
expression match.x, E1, E2;
position match.p1,match.p2;
@@

x = E1
... when != x = E2
    when != x@p1
x@p2

@ script:python depends on !other_match@
p1 << match.p1;
p2 << match.p2;
@@

print "* file %s dereference %s test %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:25 -08:00
..
2009-01-06 15:59:25 -08:00
2009-01-04 13:33:20 -08:00
2009-01-06 15:59:25 -08:00
2008-10-16 11:21:39 -07:00
2008-10-20 08:52:41 -07:00
2009-01-06 15:59:24 -08:00
2008-10-20 08:52:41 -07:00
2008-10-20 08:52:41 -07:00
2008-10-20 08:52:41 -07:00
2008-10-20 08:52:41 -07:00
2009-01-06 15:59:24 -08:00
2008-10-20 08:52:41 -07:00
2008-10-10 16:32:30 +00:00
2008-10-20 08:52:41 -07:00
2008-11-21 01:24:38 -08:00
2008-11-14 16:37:54 -08:00
2009-01-06 15:59:25 -08:00
2008-10-20 08:52:41 -07:00
2008-10-20 08:52:41 -07:00