From: Yoann Padioleau <padator@wanadoo.fr>
To: kernel-janitors@vger.kernel.org
Cc: davem@davemloft.net, sparclinux@vger.kernel.org,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH 17/68] 0 -> NULL, for arch/sparc64
Date: Fri, 27 Jul 2007 11:45:50 +0200 (MEST) [thread overview]
Message-ID: <200707270945.LAA17362@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: davem@davemloft.net
Cc: sparclinux@vger.kernel.org
Cc: akpm@linux-foundation.org
---
kernel/prom.c | 2 +-
prom/tree.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index f4e0a9a..35d4eb5 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -38,7 +38,7 @@ struct device_node *of_find_node_by_phan
{
struct device_node *np;
- for (np = allnodes; np != 0; np = np->allnext)
+ for (np = allnodes; np != NULL; np = np->allnext)
if (np->node == handle)
break;
diff --git a/arch/sparc64/prom/tree.c b/arch/sparc64/prom/tree.c
index b2c5b12..33eacd0 100644
--- a/arch/sparc64/prom/tree.c
+++ b/arch/sparc64/prom/tree.c
@@ -264,7 +264,7 @@ prom_setprop(int node, const char *pname
{
if (size == 0)
return 0;
- if ((pname == 0) || (value == 0))
+ if ((pname == NULL) || (value == NULL))
return 0;
#ifdef CONFIG_SUN_LDOMS
reply other threads:[~2007-07-27 9:52 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=200707270945.LAA17362@ifs.emn.fr \
--to=padator@wanadoo.fr \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
/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®