summaryrefslogtreecommitdiff
path: root/stand/uboot
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2019-02-18 15:09:19 +0000
committerIan Lepore <ian@FreeBSD.org>2019-02-18 15:09:19 +0000
commit85c7139a7635e3dc8575b11fa1b33df313778bd4 (patch)
treef2e03153f6654f4a29930e9d114433a24d9354f5 /stand/uboot
parent45100257c683b4421bbf134238df2c3b3aba6fad (diff)
downloadsrc-test2-85c7139a7635e3dc8575b11fa1b33df313778bd4.tar.gz
src-test2-85c7139a7635e3dc8575b11fa1b33df313778bd4.zip
Use DEV_TYP_NONE instead of -1 to indicate no device was specified.
DEV_TYP_NONE has a value of zero, which makes more sense since the device type is a bunch of bits describing the device, crammed into an int.
Notes
Notes: svn path=/head/; revision=344254
Diffstat (limited to 'stand/uboot')
-rw-r--r--stand/uboot/common/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/stand/uboot/common/main.c b/stand/uboot/common/main.c
index b1534b00d268..f31ff0694931 100644
--- a/stand/uboot/common/main.c
+++ b/stand/uboot/common/main.c
@@ -156,7 +156,7 @@ get_device_type(const char *devstr, int *devtype)
printf("Unknown device type '%s'\n", devstr);
}
- *devtype = -1;
+ *devtype = DEV_TYP_NONE;
return (NULL);
}
@@ -202,7 +202,7 @@ get_load_device(int *type, int *unit, int *slice, int *partition)
const char *p;
char *endp;
- *type = -1;
+ *type = DEV_TYP_NONE;
*unit = -1;
*slice = 0;
*partition = -1;
@@ -467,14 +467,14 @@ main(int argc, char **argv)
currdev.dd.d_dev = devsw[i];
currdev.dd.d_unit = 0;
- if ((load_type == -1 || (load_type & DEV_TYP_STOR)) &&
+ if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_STOR)) &&
strcmp(devsw[i]->dv_name, "disk") == 0) {
if (probe_disks(i, load_type, load_unit, load_slice,
load_partition) == 0)
break;
}
- if ((load_type == -1 || (load_type & DEV_TYP_NET)) &&
+ if ((load_type == DEV_TYP_NONE || (load_type & DEV_TYP_NET)) &&
strcmp(devsw[i]->dv_name, "net") == 0)
break;
}