From: Yoann Padioleau <padator@wanadoo.fr>
To: kernel-janitors@vger.kernel.org
Cc: rth@twiddle.net, ink@jurassic.park.msu.ru,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH 01/68] 0 -> NULL, for arch/alpha
Date: Fri, 27 Jul 2007 11:43:44 +0200 (MEST) [thread overview]
Message-ID: <200707270943.LAA17019@ifs.emn.fr> (raw)
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;
reply other threads:[~2007-07-27 9:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707270943.LAA17019@ifs.emn.fr \
--to=padator@wanadoo.fr \
--cc=akpm@linux-foundation.org \
--cc=ink@jurassic.park.msu.ru \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®