lkml.org 
[lkml]   [2007]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 03/68] 0 -> NULL, for arch/arm26
From

When comparing a pointer, it's clearer to compare it to NULL than to 0.

Here is an excerpt of the semantic patch:

@@
expression *E;
@@

E ==
- 0
+ NULL

@@
expression *E;
@@

E !=
- 0
+ NULL

Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>
Cc: spyro@f2s.com
Cc: akpm@linux-foundation.org
---

udivdi3.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm26/lib/udivdi3.c b/arch/arm26/lib/udivdi3.c
index d25195f..0f8e702 100644
--- a/arch/arm26/lib/udivdi3.c
+++ b/arch/arm26/lib/udivdi3.c
@@ -127,7 +127,7 @@ __udivmoddi4 (UDItype n, UDItype d, UDIt
/* Remainder in n0 >> bm. */
}

- if (rp != 0)
+ if (rp != NULL)
{
rr.s.low = n0 >> bm;
rr.s.high = 0;
@@ -144,7 +144,7 @@ __udivmoddi4 (UDItype n, UDItype d, UDIt
q1 = 0;

/* Remainder in n1n0. */
- if (rp != 0)
+ if (rp != NULL)
{
rr.s.low = n0;
rr.s.high = n1;
@@ -176,7 +176,7 @@ __udivmoddi4 (UDItype n, UDItype d, UDIt

q1 = 0;

- if (rp != 0)
+ if (rp != NULL)
{
rr.s.low = n0;
rr.s.high = n1;
@@ -208,7 +208,7 @@ __udivmoddi4 (UDItype n, UDItype d, UDIt
q1 = 0;

/* Remainder in (n1n0 - m1m0) >> bm. */
- if (rp != 0)
+ if (rp != NULL)
{
sub_ddmmss (n1, n0, n1, n0, m1, m0);
rr.s.low = (n1 << b) | (n0 >> bm);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-27 11:49    [W:0.544 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site