Author: ian
Date: Mon Feb 18 15:28:12 2019
New Revision: 344255
URL: https://svnweb.freebsd.org/changeset/base/344255

Log:
  Fix more places to use DEV_TYP_NONE instead of -1 to indicate 'no device'.

Modified:
  head/stand/uboot/common/main.c

Modified: head/stand/uboot/common/main.c
==============================================================================
--- head/stand/uboot/common/main.c      Mon Feb 18 15:09:19 2019        
(r344254)
+++ head/stand/uboot/common/main.c      Mon Feb 18 15:28:12 2019        
(r344255)
@@ -221,13 +221,13 @@ get_load_device(int *type, int *unit, int *slice, int 
                p++;
 
        /* Unknown device name, or a known name without unit number.  */
-       if ((*type == -1) || (*p == '\0')) {
+       if ((*type == DEV_TYP_NONE) || (*p == '\0')) {
                return;
        }
 
        /* Malformed unit number. */
        if (!isdigit(*p)) {
-               *type = -1;
+               *type = DEV_TYP_NONE;
                return;
        }
 
@@ -242,7 +242,7 @@ get_load_device(int *type, int *unit, int *slice, int 
 
        /* Device string is malformed beyond unit number. */
        if (*p != ':') {
-               *type = -1;
+               *type = DEV_TYP_NONE;
                *unit = -1;
                return;
        }
@@ -255,7 +255,7 @@ get_load_device(int *type, int *unit, int *slice, int 
 
        /* Only DEV_TYP_STOR devices can have a slice specification. */
        if (!(*type & DEV_TYP_STOR)) {
-               *type = -1;
+               *type = DEV_TYP_NONE;
                *unit = -1;
                return;
        }
@@ -264,7 +264,7 @@ get_load_device(int *type, int *unit, int *slice, int 
 
        /* Malformed slice number. */
        if (p == endp) {
-               *type = -1;
+               *type = DEV_TYP_NONE;
                *unit = -1;
                *slice = 0;
                return;
@@ -278,7 +278,7 @@ get_load_device(int *type, int *unit, int *slice, int 
 
        /* Device string is malformed beyond slice number. */
        if (*p != '.') {
-               *type = -1;
+               *type = DEV_TYP_NONE;
                *unit = -1;
                *slice = 0;
                return;
@@ -298,7 +298,7 @@ get_load_device(int *type, int *unit, int *slice, int 
                return;
 
        /* Junk beyond partition number. */
-       *type = -1;
+       *type = DEV_TYP_NONE;
        *unit = -1;
        *slice = 0;
        *partition = -1;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to