]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Don't print unimplemented sensor
authorKeith Busch <keith.busch@intel.com>
Mon, 27 Feb 2017 15:06:43 +0000 (10:06 -0500)
committerKeith Busch <keith.busch@intel.com>
Mon, 27 Feb 2017 15:06:43 +0000 (10:06 -0500)
This is an optional feature, no need to display it if not implemented. A
value of 0 indicates it's not used.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme-print.c

index d4dd7d5788d2c363b20833d288807a5d757eafb6..526efd4d8b1250c621173805d5825fbeebd4f6eb 100644 (file)
@@ -806,8 +806,11 @@ void show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char
        printf("Critical Composite Temperature Time : %u\n", 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;
                printf("Temperature Sensor %d                : %d C\n", c + 1,
-                       temp ? temp - 273 : 0);
+                       temp - 273);
        }
 }