From nobody Thu Aug 11 16:27:47 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 4M3XKH6lb2z4Yrsq; Thu, 11 Aug 2022 16:27:47 +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 4M3XKH60NCz3qQ7; Thu, 11 Aug 2022 16:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235267; 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=P8CynW6mouA6E1M/o+mhc6DOZ6RyyTHeetmUqihpo0k=; b=eu1hOpinPH92qMEE7xWjoqOryc7ULOwWueiJd/1jARIhw7NUfCocWp3Od7ni+2lHYfi5k2 aLMiobeVJKxTy/oZebBMzmX38xVKJVFaywg7U8oq+U+cP/c7opfeZ4doDvwg2ktoGmzlhK mLVUV9fA3gPCfjoWvBFnKMpRjWdbinXE028y0vk7JP5zgpEmj51TgQQfz0mDquyWbeIQuG ToMwDqv2qe1Oxn3TdMbWCbWnrmw0sYE79qyIPGlLciW1WM5Dm7eOpf99+NIMQyFZTMuz5I PZ0r5JvFRUOPS+npYkCqaZzYb9Icw7rW1wXtqXJx7JG/6V3IPUUZwWXEyOxvLg== 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 4M3XKH54t3zyCB; Thu, 11 Aug 2022 16:27:47 +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 27BGRlF9055504; Thu, 11 Aug 2022 16:27:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BGRlGK055503; Thu, 11 Aug 2022 16:27:47 GMT (envelope-from git) Date: Thu, 11 Aug 2022 16:27:47 GMT Message-Id: <202208111627.27BGRlGK055503@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: 1e7a2eb93a52 - main - stand: efi_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: 1e7a2eb93a527a2f4b22be66788caf50e4ba1f89 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235267; 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=P8CynW6mouA6E1M/o+mhc6DOZ6RyyTHeetmUqihpo0k=; b=UsevD1+ztIVRrBIaFs2hXcfJ4p/p708qF69bymfOIKanG1oDQ+qu95evPWA81biGKRfLyS 3g35VEJ7GXqe5wONUzSsiXCxhrIWB1/fgREZSqom7QWO3Q9JFBTdhtyi2LNDF9eheQ1YBI kwDqrKhhNzGA3/bZto68UgzpF+U9RZ9lUTqj/wyyA9mWg53lUR1mSApZOnfC0f8AJF6tVx WYgNkOJU/Y0uhHQ/hZDMGsV6610A6wQyNwBwO6xAoRwS4xzjYeGaeP+aksQ04zs7cuTRSG 1UjeLJ8rOdBtHKJ6c0ifSzdMxFMujNW93Jlk+jVneRodbTuvB/d2loKnAa0Y8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660235267; a=rsa-sha256; cv=none; b=wjhChYlmqqsri42gBEawThyar2Hlz/wHNezNzIYhWAxOlMp43uQJJxGmjO5xY0+tcXVEk+ 1hn80dQO3ncjV4Smwgu3DKv3azxQbdCdyb9+Oor0tfOXf8xlG/o78Sqm/th8YEDX35ruBj mTzlFQ5NsAVvrAWWDis2c/phvpuMIHOUh4033/Lx6ddSAZ3PEjMlQPLGWTF9TI7TW1+xoR SdTh56h2Jo1ytZlTrk1+yzQ/Zm1c4Y/2JphiOpe/HZJcrDzgBkAEEsoRMNtOtENz+eOBOg pbOSUXLG/d6KbCtBLQ/f2W+NVM5uPIg9RPLeP88sy0/Fve6e7yiXDyFk72XmOA== 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=1e7a2eb93a527a2f4b22be66788caf50e4ba1f89 commit 1e7a2eb93a527a2f4b22be66788caf50e4ba1f89 Author: Warner Losh AuthorDate: 2022-08-11 15:08:08 +0000 Commit: Warner Losh CommitDate: 2022-08-11 16:27:16 +0000 stand: efi_fmtdev can be reduced to devformat devformat produces the same output as efi_fmtdev, so just use it to reduce on the dependencies. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D35924 --- stand/efi/include/efilib.h | 1 - stand/efi/libefi/devicename.c | 26 -------------------------- stand/efi/loader/bootinfo.c | 2 +- stand/efi/loader/main.c | 4 ++-- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/stand/efi/include/efilib.h b/stand/efi/include/efilib.h index 903e1f0d00e5..bbef44fca4b3 100644 --- a/stand/efi/include/efilib.h +++ b/stand/efi/include/efilib.h @@ -85,7 +85,6 @@ efi_exit_boot_services(UINTN key) } int efi_getdev(void **vdev, const char *devspec, const char **path); -char *efi_fmtdev(void *vdev); int efi_setcurrdev(struct env_var *ev, int flags, const void *value); diff --git a/stand/efi/libefi/devicename.c b/stand/efi/libefi/devicename.c index cdf4830697fd..67a2e24d9da1 100644 --- a/stand/efi/libefi/devicename.c +++ b/stand/efi/libefi/devicename.c @@ -171,32 +171,6 @@ fail: return (err); } -char * -efi_fmtdev(void *vdev) -{ - struct devdesc *dev = (struct devdesc *)vdev; - static char buf[SPECNAMELEN + 1]; - - switch(dev->d_dev->dv_type) { - case DEVT_NONE: - strcpy(buf, "(no device)"); - break; - - case DEVT_DISK: - return (disk_fmtdev(vdev)); - -#ifdef EFI_ZFS_BOOT - case DEVT_ZFS: - return (zfs_fmtdev(dev)); -#endif - default: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); - break; - } - - return (buf); -} - /* * Set currdev to suit the value being supplied in (value) */ diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index c7b682819a98..06b131aac521 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -478,7 +478,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) } /* Try reading the /etc/fstab file to select the root device */ - getrootmount(efi_fmtdev((void *)rootdev)); + getrootmount(devformat(rootdev)); addr = 0; for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index d288c43d4592..346c600da3df 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -203,7 +203,7 @@ set_currdev_devdesc(struct devdesc *currdev) { const char *devname; - devname = efi_fmtdev(currdev); + devname = devformat(currdev); printf("Setting currdev to %s\n", devname); set_currdev(devname); } @@ -273,7 +273,7 @@ probe_zfs_currdev(uint64_t guid) currdev.pool_guid = guid; currdev.root_guid = 0; set_currdev_devdesc((struct devdesc *)&currdev); - devname = efi_fmtdev(&currdev); + devname = devformat(&currdev.dd); init_zfs_boot_options(devname); rv = sanity_check_currdev();