aboutsummaryrefslogtreecommitdiff
path: root/sbin/nvmecontrol/power.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/nvmecontrol/power.c')
-rw-r--r--sbin/nvmecontrol/power.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sbin/nvmecontrol/power.c b/sbin/nvmecontrol/power.c
index 95ee1763a28c..b26570da0c52 100644
--- a/sbin/nvmecontrol/power.c
+++ b/sbin/nvmecontrol/power.c
@@ -23,7 +23,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/ioccom.h>
@@ -63,14 +62,10 @@ power_list_one(int i, struct nvme_power_state *nps)
int mpower, apower, ipower;
uint8_t mps, nops, aps, apw;
- mps = (nps->mps_nops >> NVME_PWR_ST_MPS_SHIFT) &
- NVME_PWR_ST_MPS_MASK;
- nops = (nps->mps_nops >> NVME_PWR_ST_NOPS_SHIFT) &
- NVME_PWR_ST_NOPS_MASK;
- apw = (nps->apw_aps >> NVME_PWR_ST_APW_SHIFT) &
- NVME_PWR_ST_APW_MASK;
- aps = (nps->apw_aps >> NVME_PWR_ST_APS_SHIFT) &
- NVME_PWR_ST_APS_MASK;
+ mps = NVMEV(NVME_PWR_ST_MPS, nps->mps_nops);
+ nops = NVMEV(NVME_PWR_ST_NOPS, nps->mps_nops);
+ apw = NVMEV(NVME_PWR_ST_APW, nps->apw_aps);
+ aps = NVMEV(NVME_PWR_ST_APS, nps->apw_aps);
mpower = nps->mp;
if (mps == 0)
@@ -95,7 +90,7 @@ power_list(struct nvme_controller_data *cdata)
int i;
printf("\nPower States Supported: %d\n\n", cdata->npss + 1);
- printf(" # Max pwr Enter Lat Exit Lat RT RL WT WL Idle Pwr Act Pwr Workloadd\n");
+ printf(" # Max pwr Enter Lat Exit Lat RT RL WT WL Idle Pwr Act Pwr Workload\n");
printf("-- -------- --------- --------- -- -- -- -- -------- -------- --\n");
for (i = 0; i <= cdata->npss; i++)
power_list_one(i, &cdata->power_state[i]);