From nobody Thu Aug 11 16:27:51 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M3XKM2WQYz4Ys3s; Thu, 11 Aug 2022 16:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M3XKM21ckz3qqS; Thu, 11 Aug 2022 16:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uIqDhi7J5WzN6BIigNGYTUPkimWLYQInGdPECvHliOI=; b=JmdUKDLpCuC/9UZ3LVnYYqomtkaEd5+s9KPqQHpniNcsZIfBFknyrCHm6na2Tea2Exw5zK phBvDhXPa9GdLPF1/kskUlZlNlP/JSCweATMkbm7v+xCHGohiAkhTKvA7vHQWQzoZmwyDn qkftkj5EFMhBXteXaaVuUqp1cfyX+urOBKM4uKmPMZ3HObl0Rzcc+hcDWmJGkgWakL1VAE Zml45KioJyDgCp85oBGeOXdn8DIqPcYHKG5XzwtKjNd6bZO+SgSaSzYTfUpP5CzuUQKYbN d+MyGoR88uBTlYQFNSHLzKihM/IGd3PIxNt5XOeOk574x21DSK90UZvXdOba7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M3XKM0xqXzyKg; Thu, 11 Aug 2022 16:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27BGRpQK055582; Thu, 11 Aug 2022 16:27:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BGRpH5055581; Thu, 11 Aug 2022 16:27:51 GMT (envelope-from git) Date: Thu, 11 Aug 2022 16:27:51 GMT Message-Id: <202208111627.27BGRpH5055581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 362322294045 - main - stand: i386_fmtdev can be reduced to devformat List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 362322294045943703e03dee263bbc237002525c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uIqDhi7J5WzN6BIigNGYTUPkimWLYQInGdPECvHliOI=; b=Z+SlCAKLDM2bj+aJTmfkB8IQL3yeIenHwQ9hUQUvmg6ZP0iMiISbyqBu3YQpAOQJJQvuYZ gKXkMGpCmjTRjaBe/5ULxbPfQ/PRCDg/hUN6yf5L1RSBGJ6JogrnW5xYnQQ6FevnzX3x1B 7DFZZtJb4Mr/rHMAGt/fBnf/Fl8e1/RxMmdsmbZPs/qqVlAaB3vXaB90CttNcswHITY8Of +XT3fsLsM6jqI+DP7Eh7Z6Qaeh1mHyi0Yv+8v/7KI+2KPkf/oE+WYCiicrmjmqqEfRaM4T k0jJSIWdoAw21tVwZBrG2wtkvydC9U0ikdinvefSC7/W/B1Iof3DgwQ27NZOcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660235271; a=rsa-sha256; cv=none; b=SM3vX5qE72JL0XGiQp/LbM5FMT+KqYzTnNxmN7Jb/Qtr9U2rBC8RdTdgdZRp4eicPE3ldD GDjnttMv0HwegSqLvS73kfTR6m/Uvv+ZeI7zXMbUef/X/2iZqJXMAJQmv6+GpmFIMuMeKX t1I5UPNEn5uDNcTnIQFMA6gMDTRA7EQCCmPEuP1pGYl1YpS+QuGQvNjuNhIRRWS3d3SVbv TcfJUJDIaBrBC2Yn3uqMNAJB9g+E4IQr//iAlCaq9zrbWfn3yDzx6fxM7NdBGC2vW2QXRX PFwTbKrN68a8HzrNftJyeFGMdQi/daSFS5PVB8xotmnehHYObpkRq/GqCasrAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=362322294045943703e03dee263bbc237002525c commit 362322294045943703e03dee263bbc237002525c Author: Warner Losh AuthorDate: 2022-08-11 15:09:03 +0000 Commit: Warner Losh CommitDate: 2022-08-11 16:27:17 +0000 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 --- stand/i386/libi386/bootinfo32.c | 4 ++-- stand/i386/libi386/bootinfo64.c | 2 +- stand/i386/libi386/devicename.c | 27 --------------------------- 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); }