summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-08-30 09:49:04 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-11-22 00:00:49 +0000
commit3609799b9b2fcc73a0e26f80cc86809e06eb1d35 (patch)
tree6252ccc851f0db69176ca03a0c5d1b8003e1d038
parent4c2b235a8445ed5e7cda47bbdcbd15a509c77093 (diff)
downloadchrome-ec-3609799b9b2fcc73a0e26f80cc86809e06eb1d35.tar.gz
motion: simplify switch case
To save space, remove the default case that never happens. The case become equivalent to a __builtin_clz(sensor_active) - 27, but by leaving the other case statement, we are not dependent on the exact power state values. BUG=b:27849483 TEST=With this change, we save 40 bytes. BRANCH=none Change-Id: Idea0791f3cf50c1b3558112c877119ac1515fea6 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/378331
-rw-r--r--common/motion_sense.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 7dae82b412..fc72b036cb 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -187,14 +187,11 @@ static enum sensor_config motion_sense_get_ec_config(void)
return SENSOR_CONFIG_EC_S0;
case SENSOR_ACTIVE_S3:
return SENSOR_CONFIG_EC_S3;
- case SENSOR_ACTIVE_S5:
+ default: /* SENSOR_ACTIVE_S5 */
return SENSOR_CONFIG_EC_S5;
- default:
- CPRINTS("get_ec_config: Invalid active state: %x",
- sensor_active);
- return SENSOR_CONFIG_MAX;
}
}
+
/* motion_sense_set_data_rate
*
* Set the sensor data rate. It is altered when the AP change the data