* [PATCH] nvme-cli: smart-log: Allow negative values for temp sensors.
@ 2017-02-26 7:34 Chaitanya Kulkarni
2017-02-27 14:40 ` Sagi Grimberg
0 siblings, 1 reply; 3+ messages in thread
From: Chaitanya Kulkarni @ 2017-02-26 7:34 UTC (permalink / raw)
HGST devices allowed to produce valid negative values for
"Temperature Sensor 1" of the smart-log command. Change the
temperature sensor value from unsigned to signed so that
negative values will be printed correctly.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at hgst.com>
---
nvme-print.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nvme-print.c b/nvme-print.c
index 340317a..15129b7 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -805,8 +805,8 @@ void show_smart_log(struct nvme_smart_log *smart, unsigned int nsid, const char
printf("Warning Temperature Time : %u\n", le32_to_cpu(smart->warning_temp_time));
printf("Critical Composite Temperature Time : %u\n", le32_to_cpu(smart->critical_comp_time));
for (c=0; c < 8; c++) {
- __u16 temp = le16_to_cpu(smart->temp_sensor[c]);
- printf("Temperature Sensor %d : %u C\n", c + 1,
+ __s32 temp = le16_to_cpu(smart->temp_sensor[c]);
+ printf("Temperature Sensor %d : %d C\n", c + 1,
temp ? temp - 273 : 0);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] nvme-cli: smart-log: Allow negative values for temp sensors.
2017-02-26 7:34 [PATCH] nvme-cli: smart-log: Allow negative values for temp sensors Chaitanya Kulkarni
@ 2017-02-27 14:40 ` Sagi Grimberg
2017-02-27 15:43 ` Keith Busch
0 siblings, 1 reply; 3+ messages in thread
From: Sagi Grimberg @ 2017-02-27 14:40 UTC (permalink / raw)
Looks good,
Reviewed-by: Sagi Grimberg <sagi at grimbeg.me>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] nvme-cli: smart-log: Allow negative values for temp sensors.
2017-02-27 14:40 ` Sagi Grimberg
@ 2017-02-27 15:43 ` Keith Busch
0 siblings, 0 replies; 3+ messages in thread
From: Keith Busch @ 2017-02-27 15:43 UTC (permalink / raw)
Thanks, applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-27 15:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-26 7:34 [PATCH] nvme-cli: smart-log: Allow negative values for temp sensors Chaitanya Kulkarni
2017-02-27 14:40 ` Sagi Grimberg
2017-02-27 15:43 ` Keith Busch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.