public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 06/68] 0 -> NULL, for arch/frv
@ 2007-07-27  9:44 Yoann Padioleau
  2007-07-27 10:00 ` Al Viro
  2007-07-27 10:14 ` David Howells
  0 siblings, 2 replies; 13+ messages in thread
From: Yoann Padioleau @ 2007-07-27  9:44 UTC (permalink / raw)
  To: kernel-janitors; +Cc: dhowells, 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: dhowells@redhat.com
Cc: akpm@linux-foundation.org
---

 dma-alloc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/frv/mm/dma-alloc.c b/arch/frv/mm/dma-alloc.c
index dc6522c..eb67cef 100644
--- a/arch/frv/mm/dma-alloc.c
+++ b/arch/frv/mm/dma-alloc.c
@@ -61,7 +61,7 @@ static int map_page(unsigned long va, un
 
 	/* Use middle 10 bits of VA to index the second-level map */
 	pte = pte_alloc_kernel(pme, va);
-	if (pte != 0) {
+	if (pte != NULL) {
 		err = 0;
 		set_pte(pte, mk_pte_phys(pa & PAGE_MASK, prot));
 	}
@@ -99,7 +99,7 @@ void *consistent_alloc(gfp_t gfp, size_t
 
 	/* allocate some common virtual space to map the new pages */
 	area = get_vm_area(size, VM_ALLOC);
-	if (area == 0) {
+	if (area == NULL) {
 		free_pages(page, order);
 		return NULL;
 	}


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-08-02 14:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-27  9:44 [PATCH 06/68] 0 -> NULL, for arch/frv Yoann Padioleau
2007-07-27 10:00 ` Al Viro
2007-07-27 10:21   ` Yoann Padioleau
2007-07-27 10:40     ` Al Viro
2007-07-27 10:14 ` David Howells
2007-07-27 10:18   ` Yoann Padioleau
2007-07-28  1:38     ` Robin Getz
2007-07-28  1:37       ` Mike Frysinger
2007-07-31 12:04         ` Richard Knutsson
2007-08-01 10:03           ` Mike Frysinger
2007-08-01 10:38             ` Richard Knutsson
2007-08-01 20:28               ` Matt Mackall
2007-08-02 14:58               ` Robin Getz

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