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
This commit is contained in:
Warner Losh 2022-08-11 09:09:03 -06:00
parent add8154e45
commit 3623222940
4 changed files with 5 additions and 32 deletions

View File

@ -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);

View File

@ -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 */

View File

@ -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)
*/

View File

@ -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);
}