From bce7b5b4b69f5d397f6ee17b0400a31a4d385317 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Fri, 10 Nov 2017 10:05:33 -0800 Subject: [PATCH] ectool: Print temperature unit in ectool temps output Currently, 'ectool temps all|' just prints "300". This may easily be mistakenly read as tenth of degree C (30.0 C), as the value appears to make sense (close to room temperature). However, the value is actually 300 K (27 C). CQ-DEPEND=CL:763578 BRANCH=none BUG=chromium:783845 TEST=ectool temps all shows temperature unit (K) Change-Id: I70f7f04d061cb1d4f741d59f8b48c7963dd8280f Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/763996 Reviewed-by: Shawn N --- util/ectool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/ectool.c b/util/ectool.c index 03aa6812d1..97f86eb5c2 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -1624,7 +1624,7 @@ int cmd_temperature(int argc, char *argv[]) id); break; default: - printf("%d: %d\n", id, + printf("%d: %d K\n", id, rv + EC_TEMP_SENSOR_OFFSET); } } @@ -1660,7 +1660,7 @@ int cmd_temperature(int argc, char *argv[]) fprintf(stderr, "Sensor not calibrated\n"); return -1; default: - printf("%d\n", rv + EC_TEMP_SENSOR_OFFSET); + printf("%d K\n", rv + EC_TEMP_SENSOR_OFFSET); return 0; } }