]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
add missing endianess conversions in json_smart_log
authorChristoph Hellwig <hch@lst.de>
Fri, 23 Sep 2016 03:23:06 +0000 (20:23 -0700)
committerKeith Busch <keith.busch@intel.com>
Fri, 23 Sep 2016 14:40:25 +0000 (10:40 -0400)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme-print.c

index f9a8ff60cab1f05b628e6fdd229938a5c8378a20..ac56fcedcba083810798853501c1a7eddd2bae3e 100644 (file)
@@ -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");