aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-01-06 17:42:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:25 -0500
commitba6c4033b9db22cb54e7e03dae5b624b7b0ffaf9 (patch)
tree7bb9fea47fbd33a6ccc4a2c04ef52f50305cbd3c
parentdefb45147b85457461bfd3e57f0ecc05c18c429e (diff)
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>
-rw-r--r--drivers/rtc/rtc-bfin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 34439ce3967e..aafd3e6ebb0d 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -390,7 +390,7 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
390 390
391 /* Register our RTC with the RTC framework */ 391 /* Register our RTC with the RTC framework */
392 rtc->rtc_dev = rtc_device_register(pdev->name, dev, &bfin_rtc_ops, THIS_MODULE); 392 rtc->rtc_dev = rtc_device_register(pdev->name, dev, &bfin_rtc_ops, THIS_MODULE);
393 if (unlikely(IS_ERR(rtc))) { 393 if (unlikely(IS_ERR(rtc->rtc_dev))) {
394 ret = PTR_ERR(rtc->rtc_dev); 394 ret = PTR_ERR(rtc->rtc_dev);
395 goto err_irq; 395 goto err_irq;
396 } 396 }