LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: linuxppc-dev@lists.ozlabs.org
Cc: Breno Leitao <leitao@debian.org>
Subject: [PATCH 7/9] powerpc/scom: Return NULL instead of 0
Date: Mon, 22 Oct 2018 11:54:18 -0300	[thread overview]
Message-ID: <1540220060-30162-7-git-send-email-leitao@debian.org> (raw)
In-Reply-To: <1540220060-30162-1-git-send-email-leitao@debian.org>

Function scom_map_device() returns data type 'scom_map_t', which is a
typedef for 'void *'. This functions is currently returning NULL and zero,
which causes the following warning by 'sparse':

	arch/powerpc/sysdev/scom.c:63:24: warning: Using plain integer as NULL pointer
	arch/powerpc/sysdev/scom.c:86:24: warning: Using plain integer as NULL pointer

This patch simply replaces zero by NULL.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/sysdev/scom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/scom.c b/arch/powerpc/sysdev/scom.c
index 0f6fd5d04d33..a707b24a7ddb 100644
--- a/arch/powerpc/sysdev/scom.c
+++ b/arch/powerpc/sysdev/scom.c
@@ -60,7 +60,7 @@ scom_map_t scom_map_device(struct device_node *dev, int index)
 	parent = scom_find_parent(dev);
 
 	if (parent == NULL)
-		return 0;
+		return NULL;
 
 	/*
 	 * We support "scom-reg" properties for adding scom registers
@@ -83,7 +83,7 @@ scom_map_t scom_map_device(struct device_node *dev, int index)
 	size >>= 2;
 
 	if (index >= (size / (2*cells)))
-		return 0;
+		return NULL;
 
 	reg = of_read_number(&prop[index * cells * 2], cells);
 	cnt = of_read_number(&prop[index * cells * 2 + cells], cells);
-- 
2.19.0


  parent reply	other threads:[~2018-10-22 15:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 14:54 [PATCH 1/9] powerpc/64s: Include cpu header Breno Leitao
2018-10-22 14:54 ` [PATCH 2/9] powerpc/eeh: Declare pci_ers_result_name() as static Breno Leitao
2018-10-22 14:54 ` [PATCH 3/9] powerpc/mm: Remove extern from function definition Breno Leitao
2018-10-23 15:38   ` LEROY Christophe
2018-10-24 14:59     ` Breno Leitao
2018-10-24 15:12       ` LEROY Christophe
2018-10-31 14:43         ` Breno Leitao
2018-10-22 14:54 ` [PATCH 4/9] powerpc/xive: Define xive_do_source_eoi as static Breno Leitao
2018-10-22 14:54 ` [PATCH 5/9] powerpc/xmon: Define static functions Breno Leitao
2018-10-22 14:54 ` [PATCH 6/9] powerpc/lib: Declare static methods Breno Leitao
2018-10-22 14:54 ` Breno Leitao [this message]
2018-10-22 14:54 ` [PATCH 8/9] powerpc/perf: Declare static identifier a such Breno Leitao
2018-10-22 14:54 ` [PATCH 9/9] powerpc/pkey: Define functions as static Breno Leitao
2018-11-27  9:22 ` [1/9] powerpc/64s: Include cpu header Michael Ellerman

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=1540220060-30162-7-git-send-email-leitao@debian.org \
    --to=leitao@debian.org \
    --cc=linuxppc-dev@lists.ozlabs.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