Skip to content

Commit 86c3933

Browse files
author
Keith Busch
committed
Fix intel media wear json output
Link: linux-nvme/nvme-cli#331 Signed-off-by: Keith Busch <[email protected]>
1 parent 242b832 commit 86c3933

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

intel-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void show_intel_smart_log_jsn(struct nvme_additional_smart_log *smart,
127127

128128
entry_stats = json_create_object();
129129
json_object_add_value_int(entry_stats, "normalized", smart->timed_workload_media_wear.norm);
130-
json_object_add_value_float(entry_stats, "raw", ((float)int48_to_long(smart->timed_workload_media_wear.raw)) / 1024);
130+
json_object_add_value_float(entry_stats, "raw", ((long double)int48_to_long(smart->timed_workload_media_wear.raw)) / 1024);
131131
json_object_add_value_object(dev_stats, "timed_workload_media_wear", entry_stats);
132132

133133
entry_stats = json_create_object();

json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static void json_print_value(struct json_value *value, void *out)
394394
printf( "%llu", value->uint_number);
395395
break;
396396
case JSON_TYPE_FLOAT:
397-
printf( "%.0Lf", value->float_number);
397+
printf( "%Lf", value->float_number);
398398
break;
399399
case JSON_TYPE_OBJECT:
400400
json_print_object(value->object, out);

0 commit comments

Comments
 (0)