[ARM] arch/arm/common/sa1111.c: Correct error handling code
authorJulia Lawall <julia@diku.dk>
Sat, 13 Dec 2008 15:37:59 +0000 (16:37 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 14 Dec 2008 11:03:46 +0000 (11:03 +0000)
commit442a902262e1dfc3f1298ceea5f3120fe2043904
tree6bf2510f63591779c5c6d5c2195f75ba84b18cd7
parent674a0a6939a954ab92fdd9833943e2277550bb0a
[ARM] arch/arm/common/sa1111.c: Correct error handling code

If it is reasonable to apply PTR_ERR to the result of calling clk_get, then
that result should first be tested with IS_ERR, not with !.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression E,E1;
@@

if (
-   E == NULL
+   IS_ERR(E)
   ) { <+... when != E = E1
        PTR_ERR(E)
       ...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/common/sa1111.c