git: 3ffa7eff2275 - stable/13 - nvmecontrol: Fix power subcommand output.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Mon, 29 May 2023 00:56:11 UTC
The branch stable/13 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=3ffa7eff2275de05a3defeef859902a66f1d3135

commit 3ffa7eff2275de05a3defeef859902a66f1d3135
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2023-05-15 20:48:50 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2023-05-29 00:56:05 +0000

    nvmecontrol: Fix power subcommand output.
    
    The returned value consists of two fields.  Report them separately.
    
    MFC after:      2 weeks
    
    (cherry picked from commit f409f11bc556e6da4c4cdb9f20a2ba3b0977fb32)
---
 sbin/nvmecontrol/power.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sbin/nvmecontrol/power.c b/sbin/nvmecontrol/power.c
index 47ebc9c8c153..c6d7ad5455ff 100644
--- a/sbin/nvmecontrol/power.c
+++ b/sbin/nvmecontrol/power.c
@@ -137,7 +137,8 @@ power_show(int fd)
 	if (nvme_completion_is_error(&pt.cpl))
 		errx(EX_IOERR, "set feature power mgmt request returned error");
 
-	printf("Current Power Mode is %d\n", pt.cpl.cdw0);
+	printf("Current Power State is %d\n", pt.cpl.cdw0 & 0x1F);
+	printf("Current Workload Hint is %d\n", pt.cpl.cdw0 >> 5);
 }
 
 static void
@@ -189,7 +190,7 @@ static const struct opts power_opts[] = {
 	OPT("power", 'p', arg_uint32, opt, power,
 	    "Set the power state"),
 	OPT("workload", 'w', arg_uint32, opt, workload,
-	    "Set the workload"),
+	    "Set the workload hint"),
 	{ NULL, 0, arg_none, NULL, NULL }
 };
 #undef OPT