git: 1dade1f255ee - main - nvme: Rename NVMEB helper macro to NVMEM
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 29 Jan 2024 19:03:06 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1dade1f255ee535ad357211395b46188bece52dc commit 1dade1f255ee535ad357211395b46188bece52dc Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-01-29 18:58:28 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-01-29 18:58:28 +0000 nvme: Rename NVMEB helper macro to NVMEM The current macro always builds a full mask for a named field, so use the M suffix for mask. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43601 --- sys/dev/nvme/nvme.h | 2 +- usr.sbin/bhyve/pci_nvme.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 417651a19bb3..2c36d0813253 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -605,7 +605,7 @@ enum nvme_critical_warning_state { #define NVME_FEAT_SET_FID_MASK (0xff) /* Helper macro to combine *_MASK and *_SHIFT defines */ -#define NVMEB(name) (name##_MASK << name##_SHIFT) +#define NVMEM(name) (name##_MASK << name##_SHIFT) /* Helper macro to extract value from x */ #define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index dd6c9a41d17f..2d426fb19096 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -538,12 +538,12 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->cntrltype = NVME_CNTRLTYPE_IO; cd->oacs = 1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT; - cd->oaes = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR); + cd->oaes = NVMEM(NVME_CTRLR_DATA_OAES_NS_ATTR); cd->acl = 2; cd->aerl = 4; /* Advertise 1, Read-only firmware slot */ - cd->frmw = NVMEB(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | + cd->frmw = NVMEM(NVME_CTRLR_DATA_FRMW_SLOT1_RO) | (1 << NVME_CTRLR_DATA_FRMW_NUM_SLOTS_SHIFT); cd->lpa = 0; /* TODO: support some simple things like SMART */ cd->elpe = 0; /* max error log page entries */