From nobody Mon Jan 29 19:03:00 2024 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 4TNyP11zf3z59Ddq; Mon, 29 Jan 2024 19:03:01 +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 4TNyP11Ly4z40Jx; Mon, 29 Jan 2024 19:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706554981; 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=gjS3zoTR8rd2o8ljm8aaF8VGZiOaBXpxzsPf62/Lz78=; b=rxi9Hlv6oYFM+npRBPK5jhmlWTGYWsY1syx8boNVtjBuypISv3J792nmEH6B+zZW+8IrjP kinbcxidXG131clzzHQEPsISav3bAr91LXBDd0QGsCEE63q8RScYc++pIpXLcYEYy6Qixb RSeMotoTOFJs9hg4HxgqHDCzSFU8MsTz752gebWzHV2tC12gl6DA/+yWwey5tZ3yoF6EjP J1eQFgnAkPKtN7BpDKpW0YY9qqhBQlARgzEXqsmH1tEJUq71hUlnV0zaTg7QKS/DWpXSUj B3VkGWUDx4zwta4bBDML5Qxy5dxNJM+hJ80fYMnL5z8SkvxT1soe4egXWyFskA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706554981; 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=gjS3zoTR8rd2o8ljm8aaF8VGZiOaBXpxzsPf62/Lz78=; b=SHR1htvU2SMPY46tLHLuuAuRUOokee5Vc13ZfgEg/Ony6H0v0H3PzPNDuWmYSOEr16XGTW Gx1VoDjHfTbmu3FuEXlgpUkN/0qc0PO+7lwv4nCqNE7b31GhILO72xHU/fmt75DieveZAk wBcWrOKXLJgayaxEGBP0rIy6cic6ApGbtdfWP6EfVe8/vgCdP7aKpsCFY6S8jPYLrRdGiC Qm45xqioFrUsZAZhML4CIrvFjLBl3kRvz5B1NcbHfDJBzny1A2wQxyPbIpxuxHEaB6HTGd ZOK+uOaec3Yks214XcZUFgUt+BOt/RkRYRdgCZmHIVzCBMysVTQ805C5q5AO2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706554981; a=rsa-sha256; cv=none; b=bDyBPnQPBhJslQ5uyukDlcCB94QK1QVrQls7zTR1pmI+L7hHjD9f0vdbB/91uWSKdhc4TF S/YWf2YdCSGWNPr8KmNpBp5S+Pg8837TDjOb9gMrNX/D/89nk2sJwKXTA3b/Y1ctN3bBUz aIgJotcVrAJ376qkVziHQrz8SChkhUtdALy/afu98SIwgNzeDFn9zMlyx3dt2M8peJJPtL 1zmMP/lTr5rvlyKAhXd9+fPjZUAz4FZm9w2qXhky1H+Z5Hq2YbF9zd8TGcc+F1+9WCa25S zXpa9k0I5y3/8GwW7vAsqGNNZRs98Nvba1KQTp69NxeOoYyiGPGtjJYBd2LrLQ== 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 4TNyP10RsHz13gC; Mon, 29 Jan 2024 19:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40TJ30Cw058355; Mon, 29 Jan 2024 19:03:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TJ30ck058352; Mon, 29 Jan 2024 19:03:00 GMT (envelope-from git) Date: Mon, 29 Jan 2024 19:03:00 GMT Message-Id: <202401291903.40TJ30ck058352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2cb78e71503e - main - nda: Use the NVMEV macro instead of expanded versions 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cb78e71503ec9a73054a6f70908c5f20c2ceb73 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2cb78e71503ec9a73054a6f70908c5f20c2ceb73 commit 2cb78e71503ec9a73054a6f70908c5f20c2ceb73 Author: John Baldwin AuthorDate: 2024-01-29 18:33:39 +0000 Commit: John Baldwin CommitDate: 2024-01-29 18:33:39 +0000 nda: Use the NVMEV macro instead of expanded versions Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43596 --- sys/cam/nvme/nvme_da.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 2dd7c6d4a70b..3f6cf8702870 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -911,18 +911,15 @@ ndaregister(struct cam_periph *periph, void *arg) else if (maxio > maxphys) maxio = maxphys; /* for safety */ disk->d_maxsize = maxio; - flbas_fmt = (nsd->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) & - NVME_NS_DATA_FLBAS_FORMAT_MASK; - lbads = (nsd->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & - NVME_NS_DATA_LBAF_LBADS_MASK; + flbas_fmt = NVMEV(NVME_NS_DATA_FLBAS_FORMAT, nsd->flbas); + lbads = NVMEV(NVME_NS_DATA_LBAF_LBADS, nsd->lbaf[flbas_fmt]); disk->d_sectorsize = 1 << lbads; disk->d_mediasize = (off_t)(disk->d_sectorsize * nsd->nsze); disk->d_delmaxsize = disk->d_mediasize; disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if (nvme_ctrlr_has_dataset_mgmt(cd)) disk->d_flags |= DISKFLAG_CANDELETE; - vwc_present = (cd->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & - NVME_CTRLR_DATA_VWC_PRESENT_MASK; + vwc_present = NVMEV(NVME_CTRLR_DATA_VWC_PRESENT, cd->vwc); if (vwc_present) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { @@ -945,8 +942,8 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_hba_subdevice = cpi.hba_subdevice; snprintf(disk->d_attachment, sizeof(disk->d_attachment), "%s%d", cpi.dev_name, cpi.unit_number); - if (((nsd->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) & - NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0 && nsd->npwg != 0) + if (NVMEV(NVME_NS_DATA_NSFEAT_NPVALID, nsd->nsfeat) != 0 && + nsd->npwg != 0) disk->d_stripesize = ((nsd->npwg + 1) * disk->d_sectorsize); else disk->d_stripesize = nsd->noiob * disk->d_sectorsize;