From: Christoph Hellwig Date: Fri, 23 Sep 2016 03:23:06 +0000 (-0700) Subject: add missing endianess conversions in json_smart_log X-Git-Tag: v1.0~41 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b9eae7175921d00287f6860761e99ba308a76fc3;p=users%2Fsagi%2Fnvme-cli.git add missing endianess conversions in json_smart_log Signed-off-by: Christoph Hellwig Signed-off-by: Keith Busch --- diff --git a/nvme-print.c b/nvme-print.c index f9a8ff60..ac56fced 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -1395,8 +1395,10 @@ void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char json_object_add_value_float(root, "unsafe_shutdowns", unsafe_shutdowns); json_object_add_value_float(root, "media_errors", media_errors); json_object_add_value_float(root, "num_err_log_entries", num_err_log_entries); - json_object_add_value_int(root, "warning_temp_time", smart->warning_temp_time); - json_object_add_value_int(root, "critical_comp_time", smart->critical_comp_time); + json_object_add_value_int(root, "warning_temp_time", + le32_to_cpu(smart->warning_temp_time)); + json_object_add_value_int(root, "critical_comp_time", + le32_to_cpu(smart->critical_comp_time)); json_print_object(root, NULL); printf("\n");