Fix more places to use DEV_TYP_NONE instead of -1 to indicate 'no device'.
This commit is contained in:
parent
85c7139a76
commit
e5c0d6a0ca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344255
@ -221,13 +221,13 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
|
||||
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 *partition)
|
||||
|
||||
/* 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 *partition)
|
||||
|
||||
/* 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 *partition)
|
||||
|
||||
/* 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 *partition)
|
||||
|
||||
/* 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 *partition)
|
||||
return;
|
||||
|
||||
/* Junk beyond partition number. */
|
||||
*type = -1;
|
||||
*type = DEV_TYP_NONE;
|
||||
*unit = -1;
|
||||
*slice = 0;
|
||||
*partition = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user