sparc: explicitly cast negative phandle checks to s32
[sfrench/cifs-2.6.git] / arch / sparc / prom / tree_64.c
index d93660048376c9d9bf4478720a6825e9e7b117ed..92204c3800b57afe3366ffa49121001323c06243 100644 (file)
@@ -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;
 }