git: 8488fc417fc2 - main - nvme: Use the NVMEM macro instead of expanded versions

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 29 Jan 2024 19:03:07 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=8488fc417fc24af37fa6f1e880f09a5023670950

commit 8488fc417fc24af37fa6f1e880f09a5023670950
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-01-29 18:59:37 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-01-29 18:59:37 +0000

    nvme: Use the NVMEM macro instead of expanded versions
    
    A few of these omitted a shift of 0, but this is more consistent.
    
    Reviewed by:    chuck
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D43602
---
 sys/dev/nvme/nvme_ctrlr.c | 6 +++---
 sys/dev/nvme/nvme_ns.c    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index ad56141a556d..c662371aebfd 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -295,7 +295,7 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr)
 			return (err);
 	}
 
-	cc &= ~NVME_CC_REG_EN_MASK;
+	cc &= ~NVMEM(NVME_CC_REG_EN);
 	nvme_mmio_write_4(ctrlr, cc, cc);
 
 	/*
@@ -1215,7 +1215,7 @@ nvme_pt_done(void *arg, const struct nvme_completion *cpl)
 	pt->cpl.cdw0 = cpl->cdw0;
 
 	status = cpl->status;
-	status &= ~NVME_STATUS_P_MASK;
+	status &= ~NVMEM(NVME_STATUS_P);
 	pt->cpl.status = status;
 
 	mtx_lock(mtx);
@@ -1556,7 +1556,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr)
 	int		timeout;
 
 	cc = nvme_mmio_read_4(ctrlr, cc);
-	cc &= ~(NVME_CC_REG_SHN_MASK << NVME_CC_REG_SHN_SHIFT);
+	cc &= ~NVMEM(NVME_CC_REG_SHN);
 	cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT;
 	nvme_mmio_write_4(ctrlr, cc, cc);
 
diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c
index 89779f23ad4d..8826a1f5ff8f 100644
--- a/sys/dev/nvme/nvme_ns.c
+++ b/sys/dev/nvme/nvme_ns.c
@@ -285,7 +285,7 @@ nvme_bio_child_inbed(struct bio *parent, int bio_error)
 	if (inbed == children) {
 		bzero(&parent_cpl, sizeof(parent_cpl));
 		if (parent->bio_flags & BIO_ERROR) {
-			parent_cpl.status &= ~(NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT);
+			parent_cpl.status &= ~NVMEM(NVME_STATUS_SC);
 			parent_cpl.status |= (NVME_SC_DATA_TRANSFER_ERROR) << NVME_STATUS_SC_SHIFT;
 		}
 		nvme_ns_bio_done(parent, &parent_cpl);