diff options
author | Warner Losh <imp@FreeBSD.org> | 2022-08-11 15:09:03 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2022-08-11 16:27:17 +0000 |
commit | 362322294045943703e03dee263bbc237002525c (patch) | |
tree | 4e2c7eac95e9ac688e0e2c51cf2c369387244aff | |
parent | add8154e451f441778fb9c2fb7d10d281dea9611 (diff) | |
download | src-362322294045943703e03dee263bbc237002525c.tar.gz src-362322294045943703e03dee263bbc237002525c.zip |
stand: i386_fmtdev can be reduced to devformat
devformat produces the same output as i386_fmtdev, so just use it to
reduce on the dependencies.
Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35927
-rw-r--r-- | stand/i386/libi386/bootinfo32.c | 4 | ||||
-rw-r--r-- | stand/i386/libi386/bootinfo64.c | 2 | ||||
-rw-r--r-- | stand/i386/libi386/devicename.c | 27 | ||||
-rw-r--r-- | stand/i386/loader/main.c | 4 |
4 files changed, 5 insertions, 32 deletions
diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c index 23b02693cf48..7afb11c6a3b7 100644 --- a/stand/i386/libi386/bootinfo32.c +++ b/stand/i386/libi386/bootinfo32.c @@ -167,7 +167,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t } /* Try reading the /etc/fstab file to select the root device */ - getrootmount(i386_fmtdev((void *)rootdev)); + getrootmount(devformat(&rootdev->dd)); /* Do legacy rootdev guessing */ @@ -191,7 +191,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t rootdev->dd.d_dev->dv_type); } if (bootdevnr == -1) { - printf("root device %s invalid\n", i386_fmtdev(rootdev)); + printf("root device %s invalid\n", devformat(&rootdev->dd)); return (EINVAL); } free(rootdev); diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 1ffa4188d926..e1dc704e0e1c 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -216,7 +216,7 @@ bi_load64(char *args, vm_offset_t *modulep, } /* Try reading the /etc/fstab file to select the root device */ - getrootmount(i386_fmtdev((void *)rootdev)); + getrootmount(devformat(&rootdev->dd)); addr = 0; /* find the last module in the chain */ diff --git a/stand/i386/libi386/devicename.c b/stand/i386/libi386/devicename.c index 061f2ba9ce9f..73445aeba172 100644 --- a/stand/i386/libi386/devicename.c +++ b/stand/i386/libi386/devicename.c @@ -171,33 +171,6 @@ i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path) return(err); } - -char * -i386_fmtdev(void *vdev) -{ - struct i386_devdesc *dev = (struct i386_devdesc *)vdev; - static char buf[128]; /* XXX device length constant? */ - - switch(dev->dd.d_dev->dv_type) { - case DEVT_NONE: - strcpy(buf, "(no device)"); - break; - - case DEVT_CD: - case DEVT_NET: - sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); - break; - - case DEVT_DISK: - return (disk_fmtdev(vdev)); - - case DEVT_ZFS: - return(zfs_fmtdev(vdev)); - } - return(buf); -} - - /* * Set currdev to suit the value being supplied in (value) */ diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index c15c97c961b7..15d1c312b278 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -390,9 +390,9 @@ extract_currdev(void) init_zfs_boot_options(devformat(&new_currdev.dd)); #endif - env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), + env_setenv("currdev", EV_VOLATILE, devformat(&new_currdev.dd), i386_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), + env_setenv("loaddev", EV_VOLATILE, devformat(&new_currdev.dd), env_noset, env_nounset); } |