Author: nwhitehorn
Date: Mon Feb 19 15:49:14 2018
New Revision: 329579
URL: https://svnweb.freebsd.org/changeset/base/329579

Log:
  Set internal error returns for OF_peer(), OF_child(), and OF_parent() to
  zero, matching the IEEE 1275 standard. Since these internal error paths
  have never, to my knowledge, been taken, behavior is unchanged.
  
  Reported by:  gonzo
  MFC after:    2 weeks

Modified:
  head/sys/dev/ofw/ofw_standard.c
  head/sys/powerpc/ofw/ofw_real.c

Modified: head/sys/dev/ofw/ofw_standard.c
==============================================================================
--- head/sys/dev/ofw/ofw_standard.c     Mon Feb 19 15:47:09 2018        
(r329578)
+++ head/sys/dev/ofw/ofw_standard.c     Mon Feb 19 15:49:14 2018        
(r329579)
@@ -232,7 +232,7 @@ ofw_std_peer(ofw_t ofw, phandle_t node)
 
        args.node = node;
        if (openfirmware(&args) == -1)
-               return (-1);
+               return (0);
        return (args.next);
 }
 
@@ -254,7 +254,7 @@ ofw_std_child(ofw_t ofw, phandle_t node)
 
        args.node = node;
        if (openfirmware(&args) == -1)
-               return (-1);
+               return (0);
        return (args.child);
 }
 
@@ -276,7 +276,7 @@ ofw_std_parent(ofw_t ofw, phandle_t node)
 
        args.node = node;
        if (openfirmware(&args) == -1)
-               return (-1);
+               return (0);
        return (args.parent);
 }
 

Modified: head/sys/powerpc/ofw/ofw_real.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_real.c     Mon Feb 19 15:47:09 2018        
(r329578)
+++ head/sys/powerpc/ofw/ofw_real.c     Mon Feb 19 15:49:14 2018        
(r329579)
@@ -366,7 +366,7 @@ ofw_real_peer(ofw_t ofw, phandle_t node)
        argsptr = ofw_real_map(&args, sizeof(args));
        if (openfirmware((void *)argsptr) == -1) {
                ofw_real_stop();
-               return (-1);
+               return (0);
        }
        ofw_real_unmap(argsptr, &args, sizeof(args));
        ofw_real_stop();
@@ -395,7 +395,7 @@ ofw_real_child(ofw_t ofw, phandle_t node)
        argsptr = ofw_real_map(&args, sizeof(args));
        if (openfirmware((void *)argsptr) == -1) {
                ofw_real_stop();
-               return (-1);
+               return (0);
        }
        ofw_real_unmap(argsptr, &args, sizeof(args));
        ofw_real_stop();
@@ -424,7 +424,7 @@ ofw_real_parent(ofw_t ofw, phandle_t node)
        argsptr = ofw_real_map(&args, sizeof(args));
        if (openfirmware((void *)argsptr) == -1) {
                ofw_real_stop();
-               return (-1);
+               return (0);
        }
        ofw_real_unmap(argsptr, &args, sizeof(args));
        ofw_real_stop();
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to