From nobody Wed Nov 30 22:31:20 2022 X-Original-To: dev-commits-src-main@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 4NMv7Y1ZwNz4jCBp; Wed, 30 Nov 2022 22:31:21 +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 4NMv7X4Jbjz449s; Wed, 30 Nov 2022 22:31:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669847480; 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=M+fKTJy+Ns6VutUlgCdmYaq0EYeAwj45FPqwdNXKmkU=; b=C3skSPuBws9HHyRhqggJSjNrny7/r/8HIk/JBJdazvikzA7kJfI02zvaKZ2dCF8jDV+Y94 g91qaoWvDg7dawaqdvRzlbrRItkMaDCXUAaMiImZN+IL3wIRpd9QpvtUcMihEVksoedqkw BbeiC3qeYvkCJff/SXaVsG5XuUMAPUCEJhLRB4FQkyYhRPuZIWlvd7dn5Z0dhD6yglv3N8 SXMN+khW9DIP9U40GlSB4w8yDLUqHI7ZpW/X8FWsEffFKuZT23A8me1+nVGspc39Nfl8J6 F5MM/LCvlYlrY9xT0ZPuq47xbEluaS79Elk+ycHVj4QnH+s/ZKEbhNW/Q/MQQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669847480; 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=M+fKTJy+Ns6VutUlgCdmYaq0EYeAwj45FPqwdNXKmkU=; b=pr7hoX+WU6weW508lxTJeAOZZJT0JBlwnQQI/DwtTtCCKIGTJiMU2mB49NOgdCJPwkQ1Qr z3T8v7f5+McGCTI2f4t3u2ibrDA/hnQWj9OaLAelsqb5aXRLcjdT5AAa13GNjRQ6TOOUvP RueMWmNVx7ePy3t+O0WP35h35hRBVmXq/V26z4t7cz9BvpWYofipBLODBlOBzvqWAvcp2Z l5EmyNBZnvF2pArXSHriYDzrDrJikZJlBGdx1JK680KQBWxEnCEeAx+mCUKl7UGPnzmypB hg+i5eNjIWXPjKa6hOWD+dD5pcr0TIr1Y4AWZGmgfqVjwg+W8SDaqFk6fhVHtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669847480; a=rsa-sha256; cv=none; b=WsWByKyYs55x4RA7cTkmbw2UKoitWhafHPlie3mGYMMn0iW6dArdOx2itEGe5/LHrr064T cIbwT+uGsR7U0+RbMsdKx592FRSAmW2tPEWfMSiYgW8rn/g7tlz0dSMx7gXKIE7uH7XXMO iWXLv2prT0NNscg+r0WZNymISLrBI5iUBKgR8O2XSIdp1H4oSN76xfLwOKXugz40Hm1rvZ gdc3Gsp2B9QrgFlBoHtiaDwoFkZ2luIx7xl0hx/KqpKPm3mOrnmjI+g3iFzhmcl62vg4dA eYt4vBYsmcQFizZgOufYMhmWc0Yfkvy7Liki8Vjc70n0j09CjoKHfhRtU790qg== 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 4NMv7X3QMXz1CtQ; Wed, 30 Nov 2022 22:31:20 +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 2AUMVKY5023480; Wed, 30 Nov 2022 22:31:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AUMVKqY023479; Wed, 30 Nov 2022 22:31:20 GMT (envelope-from git) Date: Wed, 30 Nov 2022 22:31:20 GMT Message-Id: <202211302231.2AUMVKqY023479@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: d16083815caf - main - stand/ofw: Access the parsing routine more directly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: d16083815caf32dd117487c709b33669cef4af6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d16083815caf32dd117487c709b33669cef4af6f commit d16083815caf32dd117487c709b33669cef4af6f Author: Warner Losh AuthorDate: 2022-11-30 22:09:09 +0000 Commit: Warner Losh CommitDate: 2022-11-30 22:30:32 +0000 stand/ofw: Access the parsing routine more directly We don't need to check if something is a ZFS device. Instead, if the found device has a parse routine, call it. Otherwise, just copy the path. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37343 --- stand/libofw/devicename.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c index 292fba927d1a..f03703e3872f 100644 --- a/stand/libofw/devicename.c +++ b/stand/libofw/devicename.c @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libofw.h" -#include "libzfs.h" static int ofw_parsedev(struct ofw_devdesc **, const char *, const char **); @@ -109,15 +108,16 @@ found: printf("ofw_parsedev: malloc failed\n"); return ENOMEM; } - strcpy(idev->d_path, name); idev->dd.d_dev = dv; - if (dv->dv_type == DEVT_ZFS) { + if (dv->dv_parsedev != NULL) { p = devspec + strlen(dv->dv_name); free(idev); - err = zfs_parsedev((struct devdesc **)&idev, p, path); + err = dv->dv_parsedev((struct devdesc **)&idev, p, path); if (err != 0) { return (err); } + } else { + strcpy(idev->d_path, name); } if (dev == NULL) {