void json_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char *devname)
{
struct json_object *root;
+ int c;
+ char key[21];
unsigned int temperature = ((smart->temperature[1] << 8) |
smart->temperature[0]);
le32_to_cpu(smart->warning_temp_time));
json_object_add_value_int(root, "critical_comp_time",
le32_to_cpu(smart->critical_comp_time));
+
+ for (c=0; c < 8; c++) {
+ __s32 temp = le16_to_cpu(smart->temp_sensor[c]);
+
+ if (temp == 0)
+ continue;
+ sprintf(key, "temperature_sensor_%d",c+1);
+ json_object_add_value_int(root, key, temp);
+ }
+
json_object_add_value_int(root, "thm_temp1_trans_count",
le32_to_cpu(smart->thm_temp1_trans_count));
json_object_add_value_int(root, "thm_temp2_trans_count",