PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.

Sweep of the simple cases.

Cc: netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Rusty Russell 2013-07-15 11:20:32 +09:30
parent 6e8b8726ad
commit 8c6ffba0ed
43 changed files with 47 additions and 47 deletions

View file

@ -1,5 +1,5 @@
///
/// Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR
/// Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
///
// Confidence: High
// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
@ -7,7 +7,7 @@
// URL: http://coccinelle.lip6.fr/
// Options: --no-includes --include-headers
//
// Keywords: ERR_PTR, PTR_ERR, PTR_RET
// Keywords: ERR_PTR, PTR_ERR, PTR_RET, PTR_ERR_OR_ZERO
// Version min: 2.6.39
//
@ -21,21 +21,21 @@ expression ptr;
@@
- if (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0;
+ return PTR_RET(ptr);
+ return PTR_ERR_OR_ZERO(ptr);
@depends on patch@
expression ptr;
@@
- if (IS_ERR(ptr)) return PTR_ERR(ptr); return 0;
+ return PTR_RET(ptr);
+ return PTR_ERR_OR_ZERO(ptr);
@depends on patch@
expression ptr;
@@
- (IS_ERR(ptr) ? PTR_ERR(ptr) : 0)
+ PTR_RET(ptr)
+ PTR_ERR_OR_ZERO(ptr)
@r1 depends on !patch@
expression ptr;