nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] libndctl: adjusting debug output for return values of a command sent
@ 2018-03-20 21:22 Dave Jiang
  0 siblings, 0 replies; only message in thread
From: Dave Jiang @ 2018-03-20 21:22 UTC (permalink / raw)
  To: vishal.l.verma, dan.j.williams; +Cc: linux-nvdimm

Moving the success indicator next to status output to make it easier to
read since that is correlated to status and not firmware status output.
Also changing the firmware status to hex in order to reflect the spec.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 ndctl/lib/libndctl.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index a165e697..413a7db3 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -2441,11 +2441,11 @@ static int do_cmd(int fd, int ioctl_cmd, struct ndctl_cmd *cmd)
 
 	if (iter->total_xfer == 0) {
 		rc = ioctl(fd, ioctl_cmd, cmd->cmd_buf);
-		dbg(ctx, "bus: %d dimm: %#x cmd: %s%s%s status: %d fw: %d (%s)\n",
+		dbg(ctx, "bus: %d dimm: %#x cmd: %s%s%s status: %d (%s) fw: %#x\n",
 				bus->id, dimm ? ndctl_dimm_get_handle(dimm) : 0,
 				name, sub_name ? ":" : "", sub_name ? sub_name : "",
-				rc, *(cmd->firmware_status), rc < 0 ?
-				strerror(errno) : "success");
+				rc, rc < 0 ?  strerror(errno) : "success",
+				*(cmd->firmware_status));
 		if (rc < 0)
 			return -errno;
 		else
@@ -2474,12 +2474,12 @@ static int do_cmd(int fd, int ioctl_cmd, struct ndctl_cmd *cmd)
 		}
 	}
 
-	dbg(ctx, "bus: %d dimm: %#x cmd: %s%s%s total: %d max_xfer: %d status: %d fw: %d (%s)\n",
+	dbg(ctx, "bus: %d dimm: %#x cmd: %s%s%s total: %d max_xfer: %d status: %d (%s) fw: %#x\n",
 			bus->id, dimm ? ndctl_dimm_get_handle(dimm) : 0,
 			name, sub_name ? ":" : "", sub_name ? sub_name : "",
 			iter->total_xfer, iter->max_xfer, rc,
-			*(cmd->firmware_status),
-			rc < 0 ? strerror(errno) : "success");
+			rc < 0 ? strerror(errno) : "success",
+			*(cmd->firmware_status));
 
 	return rc;
 }

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-20 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 21:22 [PATCH] libndctl: adjusting debug output for return values of a command sent Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).