From patchwork Tue Feb 24 11:14:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 442945 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9AD06140082 for ; Tue, 24 Feb 2015 22:17:16 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 868AB1A154A for ; Tue, 24 Feb 2015 22:17:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 392131A1540 for ; Tue, 24 Feb 2015 22:15:45 +1100 (AEDT) Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Feb 2015 11:15:42 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Feb 2015 11:15:40 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id E72DE219005C for ; Tue, 24 Feb 2015 11:15:32 +0000 (GMT) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1OBFdNA63307948 for ; Tue, 24 Feb 2015 11:15:39 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1OBFcc1029071 for ; Tue, 24 Feb 2015 04:15:39 -0700 Received: from hermes.kaod.org (sig-9-84-121-52.evts.de.ibm.com [9.84.121.52]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t1OBFF8f028018; Tue, 24 Feb 2015 04:15:38 -0700 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: skiboot@lists.ozlabs.org Date: Tue, 24 Feb 2015 12:14:37 +0100 Message-Id: <1424776479-13958-24-git-send-email-clg@fr.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1424776479-13958-1-git-send-email-clg@fr.ibm.com> References: <1424776479-13958-1-git-send-email-clg@fr.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15022411-0017-0000-0000-000003234F8D Subject: [Skiboot] [PATCH 23/25] sparse: fix Using plain integer as NULL pointer warning X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Cédric Le Goater --- 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 */