summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-07-09 14:49:51 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-10 03:40:34 +0000
commit8c1d76e52cd360557a08e64c3300bb0e29f6637b (patch)
treef10eb5692cc3b82444becb0ee076ca708dcafe9e
parentd6a8520f6b5273724aea540429e7b55e558051df (diff)
downloadchrome-ec-8c1d76e52cd360557a08e64c3300bb0e29f6637b.tar.gz
ectool: Fix compilation warning
Was comparting a int16_t with 0x8000 leading to: error: comparison of constant 32768 with expression of ec-utils-0.0.1-r2377: type 'int16_t' (aka 'short') is always false (Builder: Chromium OS (x86) Asan (stats) 7005) BRANCH=smaug TEST=On Smaug check that ectool does report invalid temperature when EC returns 0x8000. Check the temperature is correct when the EC returns a valid temperature. BUG=chromium:508674 Change-Id: I2a1414cf7bf018ecaa7ff8dd37c76804de4bce52 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284673 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
-rw-r--r--util/ectool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c
index d14caca71e..d6a32019c7 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -3602,7 +3602,7 @@ static int cmd_motionsense(int argc, char **argv)
resp->sensor_offset.offset[0],
resp->sensor_offset.offset[1],
resp->sensor_offset.offset[2]);
- if (resp->sensor_offset.temp ==
+ if ((uint16_t)resp->sensor_offset.temp ==
EC_MOTION_SENSE_INVALID_CALIB_TEMP)
printf("temperature at calibration unknown\n");
else