summaryrefslogtreecommitdiff
path: root/arch/sparc/prom/tree_64.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2010-11-11 22:42:06 -0800
committerGrant Likely <grant.likely@secretlab.ca>2011-01-03 20:02:06 -0700
commit4a3a255289e7e322b8044286cce85031990f888a (patch)
tree60afe5f0fc76b2b4edb5374023806e26fc50fb4a /arch/sparc/prom/tree_64.c
parent301a3da358b4af84915f575479e4f0885be47b73 (diff)
sparc: explicitly cast negative phandle checks to s32
When we switched sparc from using 'int's to 'phandle's (which is a u32), we neglected to do anything with the various checks for -1. For those tests, explicitly cast the phandles to s32. Signed-off-by: Andres Salomon <dilinger@queued.net> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/sparc/prom/tree_64.c')
-rw-r--r--arch/sparc/prom/tree_64.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index d93660048376..92204c3800b5 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -43,10 +43,10 @@ inline phandle prom_getchild(phandle node)
{
phandle cnode;
- if (node == -1)
+ if ((s32)node == -1)
return 0;
cnode = __prom_getchild(node);
- if (cnode == -1)
+ if ((s32)cnode == -1)
return 0;
return cnode;
}
@@ -56,10 +56,10 @@ inline phandle prom_getparent(phandle node)
{
phandle cnode;
- if (node == -1)
+ if ((s32)node == -1)
return 0;
cnode = prom_node_to_node("parent", node);
- if (cnode == -1)
+ if ((s32)cnode == -1)
return 0;
return cnode;
}
@@ -76,10 +76,10 @@ inline phandle prom_getsibling(phandle node)
{
phandle sibnode;
- if (node == -1)
+ if ((s32)node == -1)
return 0;
sibnode = __prom_getsibling(node);
- if (sibnode == -1)
+ if ((s32)sibnode == -1)
return 0;
return sibnode;
@@ -240,7 +240,7 @@ inline char *prom_firstprop(phandle node, char *buffer)
unsigned long args[7];
*buffer = 0;
- if (node == -1)
+ if ((s32)node == -1)
return buffer;
args[0] = (unsigned long) prom_nextprop_name;
@@ -266,7 +266,7 @@ inline char *prom_nextprop(phandle node, const char *oprop, char *buffer)
unsigned long args[7];
char buf[32];
- if (node == -1) {
+ if ((s32)node == -1) {
*buffer = 0;
return buffer;
}
@@ -369,7 +369,7 @@ inline phandle prom_inst2pkg(int inst)
p1275_cmd_direct(args);
node = (int) args[4];
- if (node == -1)
+ if ((s32)node == -1)
return 0;
return node;
}