summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-03-18 12:50:09 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-03-18 20:49:23 -0700
commitf06443e2f7020b98dbb7145bedc930327b8c25dd (patch)
tree013890be783343ab312c43f7aa8955700f44b2dd
parente3623405c62d7216dff5d85a190f3012fb9fc6dc (diff)
downloadchrome-ec-f06443e2f7020b98dbb7145bedc930327b8c25dd.tar.gz
ectool: Eliminate needless stderr output from `tempsinfo`
`tempsinfo all` will probe all 24 sensor IDs, which will produce stderr output due to host command failure if a given sensor does not exist. Therefore, check memmap data for presence before probing a given ID. BUG=chrome-os-partner:51026 BRANCH=None TEST=Manual on Sentry. Verify "ectool tempsinfo all" dumps info on 4 temperature sensors and prints nothing to stderr. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I14d65c1ad03eafafc21db41781c434b3ed74cb7e Reviewed-on: https://chromium-review.googlesource.com/333779 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--util/ectool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c
index 98c159cd66..0fbcafe050 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1431,6 +1431,9 @@ int cmd_temp_sensor_info(int argc, char *argv[])
for (p.id = 0;
p.id < EC_TEMP_SENSOR_ENTRIES + EC_TEMP_SENSOR_B_ENTRIES;
p.id++) {
+ if (read_mapped_temperature(p.id) ==
+ EC_TEMP_SENSOR_NOT_PRESENT)
+ continue;
rv = ec_command(EC_CMD_TEMP_SENSOR_GET_INFO, 0,
&p, sizeof(p), &r, sizeof(r));
if (rv < 0)