aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/prom/tree_64.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2010-11-12 01:42:06 -0500
committerGrant Likely <grant.likely@secretlab.ca>2011-01-03 22:02:06 -0500
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)
43{ 43{
44 phandle cnode; 44 phandle cnode;
45 45
46 if (node == -1) 46 if ((s32)node == -1)
47 return 0; 47 return 0;
48 cnode = __prom_getchild(node); 48 cnode = __prom_getchild(node);
49 if (cnode == -1) 49 if ((s32)cnode == -1)
50 return 0; 50 return 0;
51 return cnode; 51 return cnode;
52} 52}
@@ -56,10 +56,10 @@ inline phandle prom_getparent(phandle node)
56{ 56{
57 phandle cnode; 57 phandle cnode;
58 58
59 if (node == -1) 59 if ((s32)node == -1)
60 return 0; 60 return 0;
61 cnode = prom_node_to_node("parent", node); 61 cnode = prom_node_to_node("parent", node);
62 if (cnode == -1) 62 if ((s32)cnode == -1)
63 return 0; 63 return 0;
64 return cnode; 64 return cnode;
65} 65}
@@ -76,10 +76,10 @@ inline phandle prom_getsibling(phandle node)
76{ 76{
77 phandle sibnode; 77 phandle sibnode;
78 78
79 if (node == -1) 79 if ((s32)node == -1)
80 return 0; 80 return 0;
81 sibnode = __prom_getsibling(node); 81 sibnode = __prom_getsibling(node);
82 if (sibnode == -1) 82 if ((s32)sibnode == -1)
83 return 0; 83 return 0;
84 84
85 return sibnode; 85 return sibnode;
@@ -240,7 +240,7 @@ inline char *prom_firstprop(phandle node, char *buffer)
240 unsigned long args[7]; 240 unsigned long args[7];
241 241
242 *buffer = 0; 242 *buffer = 0;
243 if (node == -1) 243 if ((s32)node == -1)
244 return buffer; 244 return buffer;
245 245
246 args[0] = (unsigned long) prom_nextprop_name; 246 args[0] = (unsigned long) prom_nextprop_name;
@@ -266,7 +266,7 @@ inline char *prom_nextprop(phandle node, const char *oprop, char *buffer)
266 unsigned long args[7]; 266 unsigned long args[7];
267 char buf[32]; 267 char buf[32];
268 268
269 if (node == -1) { 269 if ((s32)node == -1) {
270 *buffer = 0; 270 *buffer = 0;
271 return buffer; 271 return buffer;
272 } 272 }
@@ -369,7 +369,7 @@ inline phandle prom_inst2pkg(int inst)
369 p1275_cmd_direct(args); 369 p1275_cmd_direct(args);
370 370
371 node = (int) args[4]; 371 node = (int) args[4];
372 if (node == -1) 372 if ((s32)node == -1)
373 return 0; 373 return 0;
374 return node; 374 return node;
375} 375}