diff mbox

libndctl: adjusting debug output for return values of a command sent

Message ID 152158094585.50363.3257731526504862041.stgit@djiang5-desk3.ch.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Jiang March 20, 2018, 9:22 p.m. UTC
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 mbox

Patch

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;
 }