diff mbox series

[7/9] powerpc/scom: Return NULL instead of 0

Message ID 1540220060-30162-7-git-send-email-leitao@debian.org (mailing list archive)
State Accepted
Commit 3347c9f691bf23c65375c51f904c848b36b6f8fb
Headers show
Series [1/9] powerpc/64s: Include cpu header | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch success Test checkpatch on branch next

Commit Message

Breno Leitao Oct. 22, 2018, 2:54 p.m. UTC
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 mbox series

Patch

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);