diff options
author | Chih-Hung Hsieh <chh@google.com> | 2014-12-10 15:01:32 -0800 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2014-12-15 15:20:08 -0800 |
commit | aa6e3cf47e19e4cf2c98490bef5e200934a39ee6 (patch) | |
tree | 583e64156aba514e5995f65202ce9f11abf2db62 | |
parent | 2c8c33640068663259bcfa1789abe53b3bff4258 (diff) | |
download | android_hardware_invensense-aa6e3cf47e19e4cf2c98490bef5e200934a39ee6.tar.gz android_hardware_invensense-aa6e3cf47e19e4cf2c98490bef5e200934a39ee6.tar.bz2 android_hardware_invensense-aa6e3cf47e19e4cf2c98490bef5e200934a39ee6.zip |
Ignore or fix trivial clang compiler warnings.
* Unused parameters and private fields are harmless.
* GNU designator syntax is accepted by clang too.
* Typo in include guard is fixed.
* Comparing array to NULL is redundant, but we should change
the source code. The same warning could be given to other
kind of pointer comparisons that we want to catch.
Change-Id: Ia6999e955e026c9e6bc81355b788b29dc53cae42
-rw-r--r-- | 65xx/libsensors_iio/Android.mk | 10 | ||||
-rw-r--r-- | 65xx/libsensors_iio/MPLSensor.cpp | 7 | ||||
-rw-r--r-- | 65xx/libsensors_iio/software/core/mpl/gyro_tc.h | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/65xx/libsensors_iio/Android.mk b/65xx/libsensors_iio/Android.mk index 363549f..5d2cf4f 100644 --- a/65xx/libsensors_iio/Android.mk +++ b/65xx/libsensors_iio/Android.mk @@ -15,9 +15,16 @@ LOCAL_PATH := $(call my-dir) +# Too many benign warnings to be fixed later. +my_ignored_clang_warnings := \ + -Wno-unused-parameter \ + -Wno-unused-private-field \ + -Wno-gnu-designator + # InvenSense fragment of the HAL include $(CLEAR_VARS) +LOCAL_CLANG_CFLAGS += $(my_ignored_clang_warnings) LOCAL_MODULE := libinvensense_hal LOCAL_MODULE_TAGS := optional LOCAL_MODULE_OWNER := invensense @@ -91,6 +98,8 @@ include $(BUILD_SHARED_LIBRARY) # Build a temporary HAL that links the InvenSense .so include $(CLEAR_VARS) + +LOCAL_CLANG_CFLAGS += $(my_ignored_clang_warnings) ifneq ($(filter dory guppy guppypdk, $(TARGET_DEVICE)),) LOCAL_MODULE := sensors.invensense else @@ -183,3 +192,4 @@ OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES) LOCAL_STRIP_MODULE := true include $(BUILD_PREBUILT) +my_ignored_clang_warnings := diff --git a/65xx/libsensors_iio/MPLSensor.cpp b/65xx/libsensors_iio/MPLSensor.cpp index 77f54fd..d63c0ae 100644 --- a/65xx/libsensors_iio/MPLSensor.cpp +++ b/65xx/libsensors_iio/MPLSensor.cpp @@ -4710,9 +4710,10 @@ int MPLSensor::populateSensorList(struct sensor_t *list, int len) /* first add gyro, accel and compass to the list */ /* fill in gyro/accel values */ - if(chip_ID == NULL) { - LOGE("HAL:Can not get gyro/accel id"); - } + // chip_ID is an array and will never equal to NULL. + //if(chip_ID == NULL) { + // LOGE("HAL:Can not get gyro/accel id"); + //} fillGyro(chip_ID, list); fillAccel(chip_ID, list); diff --git a/65xx/libsensors_iio/software/core/mpl/gyro_tc.h b/65xx/libsensors_iio/software/core/mpl/gyro_tc.h index 3347a14..183afa9 100644 --- a/65xx/libsensors_iio/software/core/mpl/gyro_tc.h +++ b/65xx/libsensors_iio/software/core/mpl/gyro_tc.h @@ -12,7 +12,7 @@ *****************************************************************************/ #ifndef _GYRO_TC_H -#define _GYRO_TC_H_ +#define _GYRO_TC_H #include "mltypes.h" |