summaryrefslogtreecommitdiff
path: root/sensors/aidl/default/Sensor.cpp
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2022-02-09 15:47:54 -0800
committerChih-Hung Hsieh <chh@google.com>2022-02-09 15:47:54 -0800
commit91b4835adaaba1ea8d3b25f383a85d5044332e07 (patch)
tree8a474ed24f719e314b09601ae3d9d5254f2acac1 /sensors/aidl/default/Sensor.cpp
parent55a87cc169de8b9e402fae2e564657be0bf69d36 (diff)
Fix cert-dcl16-c warnings
Bug: 120614316 Test: make tidy-hardware-interfaces-sensors-aidl_subset Change-Id: Ia9f5a9153b1591623aff0df4e185f445762bcbaf
Diffstat (limited to 'sensors/aidl/default/Sensor.cpp')
-rw-r--r--sensors/aidl/default/Sensor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sensors/aidl/default/Sensor.cpp b/sensors/aidl/default/Sensor.cpp
index 50d8841b2a..62193d6c9b 100644
--- a/sensors/aidl/default/Sensor.cpp
+++ b/sensors/aidl/default/Sensor.cpp
@@ -52,10 +52,10 @@ const SensorInfo& Sensor::getSensorInfo() const {
}
void Sensor::batch(int64_t samplingPeriodNs) {
- if (samplingPeriodNs < mSensorInfo.minDelayUs * 1000ll) {
- samplingPeriodNs = mSensorInfo.minDelayUs * 1000ll;
- } else if (samplingPeriodNs > mSensorInfo.maxDelayUs * 1000ll) {
- samplingPeriodNs = mSensorInfo.maxDelayUs * 1000ll;
+ if (samplingPeriodNs < mSensorInfo.minDelayUs * 1000LL) {
+ samplingPeriodNs = mSensorInfo.minDelayUs * 1000LL;
+ } else if (samplingPeriodNs > mSensorInfo.maxDelayUs * 1000LL) {
+ samplingPeriodNs = mSensorInfo.maxDelayUs * 1000LL;
}
if (mSamplingPeriodNs != samplingPeriodNs) {