From: Yoann Padioleau <padator@wanadoo.fr>
To: kernel-janitors@vger.kernel.org
Cc: chris@zankel.net, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 20/68] 0 -> NULL, for arch/xtensa
Date: Fri, 27 Jul 2007 11:47:47 +0200 (MEST) [thread overview]
Message-ID: <200707270947.LAA17593@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: chris@zankel.net
Cc: akpm@linux-foundation.org
---
kernel/pci.c | 2 +-
kernel/traps.c | 2 +-
platform-iss/console.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index 77deae5..1102816 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -306,7 +306,7 @@ __pci_mmap_make_offset(struct pci_dev *d
unsigned long io_offset = 0;
int i, res_bit;
- if (pci_ctrl == 0)
+ if (pci_ctrl == NULL)
return -EINVAL; /* should never happen */
/* If memory, add on the PCI bridge address offset */
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index c5e62f9..eb21c7c 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -419,7 +419,7 @@ void show_stack(struct task_struct *task
int i = 0;
unsigned long *stack;
- if (sp == 0)
+ if (sp == NULL)
__asm__ __volatile__ ("mov %0, a1\n" : "=a"(sp));
stack = sp;
diff --git a/arch/xtensa/platform-iss/console.c b/arch/xtensa/platform-iss/console.c
index 2f4f20f..ad8d65e 100644
--- a/arch/xtensa/platform-iss/console.c
+++ b/arch/xtensa/platform-iss/console.c
@@ -265,7 +265,7 @@ static void iss_console_write(struct con
{
int len = strlen(s);
- if (s != 0 && *s != 0)
+ if (s != NULL && *s != 0)
__simc (SYS_write, 1, (unsigned long)s,
count < len ? count : len,0,0);
}
reply other threads:[~2007-07-27 9:53 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=200707270947.LAA17593@ifs.emn.fr \
--to=padator@wanadoo.fr \
--cc=akpm@linux-foundation.org \
--cc=chris@zankel.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).