git: 2208f2c15688 - stable/14 - nvme: Use the NVMEM macro instead of expanded versions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 Aug 2024 18:03:18 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=2208f2c15688e6b517680535053bfba39b67c0a4
commit 2208f2c15688e6b517680535053bfba39b67c0a4
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-01-29 18:59:37 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-08-26 17:26:47 +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
(cherry picked from commit 8488fc417fc24af37fa6f1e880f09a5023670950)
---
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 7096f0443f1d..3ef5a2b51544 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -326,7 +326,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);
/*
@@ -1258,7 +1258,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);
@@ -1600,7 +1600,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 329b8d583898..c172663f75a3 100644
--- a/sys/dev/nvme/nvme_ns.c
+++ b/sys/dev/nvme/nvme_ns.c
@@ -286,7 +286,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);