[Skiboot] [PATCH 23/25] sparse: fix Using plain integer as NULL pointer warning

Cédric Le Goater clg at fr.ibm.com
Tue Feb 24 22:14:37 AEDT 2015


Signed-off-by: Cédric Le Goater <clg at fr.ibm.com>
---
 core/cpu.c                      |    2 +-
 core/hostservices.c             |    2 +-
 libc/stdlib/strtol.c            |    2 +-
 libc/stdlib/strtoul.c           |    2 +-
 libpore/pore_inline_assembler.c |    4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/cpu.c b/core/cpu.c
index bfede549eb4f..4c97ab982b47 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -449,7 +449,7 @@ void init_all_cpus(void)
 		t->primary = t;
 		t->node = cpu;
 		t->chip_id = chip_id;
-		t->icp_regs = 0; /* Will be set later */
+		t->icp_regs = NULL; /* Will be set later */
 
 		/* Add associativity properties */
 		add_core_associativity(t);
diff --git a/core/hostservices.c b/core/hostservices.c
index 2de24aa25950..9ebf3162fb71 100644
--- a/core/hostservices.c
+++ b/core/hostservices.c
@@ -890,7 +890,7 @@ bool hservices_init(void)
 	/* We enter at 0x100 into the image. */
 	fdesc.addr = code + 0x100;
 	/* It doesn't care about TOC */
-	fdesc.toc = 0;
+	fdesc.toc = NULL;
 
 	hbrt_init = (void *)&fdesc;
 
diff --git a/libc/stdlib/strtol.c b/libc/stdlib/strtol.c
index 474597a23b05..b1468b25ce48 100644
--- a/libc/stdlib/strtol.c
+++ b/libc/stdlib/strtol.c
@@ -19,7 +19,7 @@ long int strtol(const char *S, char **PTR,int BASE)
 	short int digit;
 	// *PTR is S, unless PTR is NULL, in which case i override it with my own ptr
 	char* ptr;
-	if (PTR == 0)
+	if (PTR == NULL)
 	{
 		//override
 		PTR = &ptr;
diff --git a/libc/stdlib/strtoul.c b/libc/stdlib/strtoul.c
index 754e7db4b14e..4131d5879a4a 100644
--- a/libc/stdlib/strtoul.c
+++ b/libc/stdlib/strtoul.c
@@ -18,7 +18,7 @@ unsigned long int strtoul(const char *S, char **PTR,int BASE)
 	short int digit;
 	// *PTR is S, unless PTR is NULL, in which case i override it with my own ptr
 	char* ptr;
-	if (PTR == 0)
+	if (PTR == NULL)
 	{
 		//override
 		PTR = &ptr;
diff --git a/libpore/pore_inline_assembler.c b/libpore/pore_inline_assembler.c
index 470b2fa471a1..44a93db834bf 100644
--- a/libpore/pore_inline_assembler.c
+++ b/libpore/pore_inline_assembler.c
@@ -747,7 +747,7 @@ pore_inline_context_create(PoreInlineContext *ctx,
         PORE_INLINE_8_BYTE_DATA      |
         PORE_INLINE_DISASSEMBLE_UNKNOWN;
 
-    if ((ctx == 0) || ((memory == 0) && (size != 0)) || 
+    if ((ctx == NULL) || ((memory == NULL) && (size != 0)) ||
 	((options & ~valid_options) != 0)) {
 	rc = PORE_INLINE_INVALID_PARAMETER;
     } else {
@@ -759,7 +759,7 @@ pore_inline_context_create(PoreInlineContext *ctx,
 	pore_inline_context_reset(ctx);
     }
 
-    if (ctx != 0) {
+    if (ctx != NULL) {
         ctx->error = rc;
         if (rc) {
             ctx->size = 0;      /* Effectively prevents using the ctx */
-- 
1.7.10.4



More information about the Skiboot mailing list