mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 01/68] 0 -> NULL, for arch/alpha
@ 2007-07-27  9:43 Yoann Padioleau
  0 siblings, 0 replies; only message in thread
From: Yoann Padioleau @ 2007-07-27  9:43 UTC (permalink / raw)
  To: kernel-janitors; +Cc: rth, ink, akpm, linux-kernel


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: rth@twiddle.net
Cc: ink@jurassic.park.msu.ru
Cc: akpm@linux-foundation.org
---

 kernel/smp.c   |    4 ++--
 kernel/traps.c |    2 +-
 mm/fault.c     |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index b287314..4317a7c 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -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;
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index ec0f05e..48b4015 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -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);
 
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index a0e18da..dffca85 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-27  9:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-27  9:43 [PATCH 01/68] 0 -> NULL, for arch/alpha Yoann Padioleau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®