mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
powerpc/scom: Return NULL instead of 0
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> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
3b30c6e8b9
commit
3347c9f691
1 changed files with 2 additions and 2 deletions
|
@ -60,7 +60,7 @@ scom_map_t scom_map_device(struct device_node *dev, int index)
|
||||||
parent = scom_find_parent(dev);
|
parent = scom_find_parent(dev);
|
||||||
|
|
||||||
if (parent == NULL)
|
if (parent == NULL)
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We support "scom-reg" properties for adding scom registers
|
* 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;
|
size >>= 2;
|
||||||
|
|
||||||
if (index >= (size / (2*cells)))
|
if (index >= (size / (2*cells)))
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
reg = of_read_number(&prop[index * cells * 2], cells);
|
reg = of_read_number(&prop[index * cells * 2], cells);
|
||||||
cnt = of_read_number(&prop[index * cells * 2 + cells], cells);
|
cnt = of_read_number(&prop[index * cells * 2 + cells], cells);
|
||||||
|
|
Loading…
Add table
Reference in a new issue