Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2019 15:28:12 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344255 - head/stand/uboot/common
Message-ID:  <201902181528.x1IFSC5V060239@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902181528.x1IFSC5V060239>