From nobody Mon Aug 26 18:03:11 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 4Wsz735kkhz5TLnS; Mon, 26 Aug 2024 18:03:11 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz734q53z44l6; Mon, 26 Aug 2024 18:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695391; 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=jgm+0gLO6b1UaTWLW+JwCCsU8LWSO9ROqyJ79su0oCE=; b=e7KvA0SCeDJ7js0xIJae2CRO2uoksjtq7Tg5Sy9h1udtr7R+zH/OdTMIQC2weUbvD41Plq 7VvI4fMs7Miw44f1eiUsm5xoCbhEVlYkTjxxNz3AxC+bLRN1Hdbl25vg5zYdg2IWfBk1wK bjGlH+S9kAlAOSxtBz8eB1J+Pl2eOiEKIPrTvBkJZrjJNbkR3nqyRMYO1xpaDBoSvdqL2u W4RE6RP2x37qNn0FAWAd9jwtHvl32xWhRZE93BNh82/1zWLUz+inmtaMD7C7Hutp5v4Mo6 NFb79JgakyNg/RLFmNovu01+YvvqJ9DjwZjXhMhE7SdFwAI481D9n7OTGcnzRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695391; a=rsa-sha256; cv=none; b=nq+SzU3P402CXGx0G+kL+F1Y2zq1mh1MCFLxHzOkROUMRM5bJDyJs4gvVXk21pqN9Arv6s r0ARbCLw5B7dJbKoxNTzPouAykjqajaf27Zz9vL5Kx3Vt05jITveTo3Ctf9UDx6hh0uXak PYumeTwe7RxPmF8SPgRdOMv3shJwnvGMIoXSa4/9Tsr/farMnMY2b4oDZqRWNvEuvHvuOh jchLbPAe9dnjYdo4e4XNxwZxSgSJjqx5HaAlrTMNAGS4BZW4Kcwg8hwLYFUUD783QwIclj Tf77Cqp13Bg+VtxBIzwBTFGQAAdYPokfc50+pWJh8u7YHM4cd8QUuAmcCeYedg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695391; 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=jgm+0gLO6b1UaTWLW+JwCCsU8LWSO9ROqyJ79su0oCE=; b=xsc5zL+DxgN7zk860k9t2sBI3O2pG30I/CNFnsHXkFAmqZfj6FbhTnGosGxfN+jLXyrobw rdNF007nWIm0Mf8UbOnXZIHmmi8GIE1HsSARtbW0RXGfl6ccGNVMbKD8ElJj5DrFz1P06h +rAxUOXz5VXu8K4pETQ+gvSA/bg77EOrBQzkD08iw61RTkt446h8bIvd0FNIwn2h+R00l7 VLrWq4Z4M4CMFEKMHt5R3sDXLd95r21x2wXLuqvj4Pu23SG1B6SBwMp4zBTPuO+CaRJbtl dwRORyHHi8OjT7qUiQ+kzmZ4Xl3LF4XUsnvZya60MzBseECkzR2jv3xRbS7G9w== 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 4Wsz734QmmzH6K; Mon, 26 Aug 2024 18:03:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QI3B8p042336; Mon, 26 Aug 2024 18:03:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3BpQ042333; Mon, 26 Aug 2024 18:03:11 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:11 GMT Message-Id: <202408261803.47QI3BpQ042333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e8edea1b4cc5 - stable/14 - 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/14 X-Git-Reftype: branch X-Git-Commit: e8edea1b4cc5aae7897439821a611257a32a879c Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e8edea1b4cc5aae7897439821a611257a32a879c commit e8edea1b4cc5aae7897439821a611257a32a879c Author: John Baldwin AuthorDate: 2024-01-29 18:33:39 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:00 +0000 nda: Use the NVMEV macro instead of expanded versions Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43596 (cherry picked from commit 2cb78e71503ec9a73054a6f70908c5f20c2ceb73) --- 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 9901ecccf21c..33efbc66773c 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -912,18 +912,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) { @@ -946,8 +943,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;