0 -> NULL, for arch/alpha
Subsystems (2)
PATCH 1/68 0 -> NULL, for arch/alpha
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 <[email protected]>
---
kernel/smp.c | 4 ++-- kernel/traps.c | 2 +- mm/fault.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/alpha/kernel/smp.c +2 -2
@@ -270,7 +270,7 @@ recv_secondary_console_msg(void) cp2 = buf;strcpy (cp2, cp1); -while ((cp2 =strchr (cp2,'\r' )) !=0 ) { +while ((cp2 =strchr (cp2,'\r' )) !=NULL ) { *cp2 =' ' ;if (cp2[1 ] ='\n' ) cp2[1 ] =' ' ;
@@ -597,7 +597,7 @@ pointer_lock (void *lock, void *data, in : "r"(data) : "memory"); -if (old =0 ) +if (old =NULL )return 0 ;if (! retry)return -EBUSY ;
arch/alpha/kernel/traps.c +1 -1
@@ -628,7 +628,7 @@ do_entUna(void * va, unsigned long opcod got_exception:/* Ok, we caught the exception, but we don't want it. Is there someone to pass it along to? */ -if ((fixup =search_exception_tables (pc)) !=0 ) { +if ((fixup =search_exception_tables (pc)) !=NULL ) {unsigned long newpc; newpc =fixup_exception (una_reg, fixup, pc);
arch/alpha/mm/fault.c +1 -1
@@ -171,7 +171,7 @@ #endif no_context:/* Are we prepared to handle this fault as an exception? */ -if ((fixup =search_exception_tables (regs->pc)) !=0 ) { +if ((fixup =search_exception_tables (regs->pc)) !=NULL ) {unsigned long newpc; newpc =fixup_exception (dpf_reg, fixup, regs->pc); regs->pc = newpc;