summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-hung Hsieh <chh@google.com>2015-01-05 23:45:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-05 23:45:51 +0000
commita98d5eeceed1b037921e8285d5e533191244495f (patch)
tree5d617e8dd9f47b6ca38dcb78d9fe4803880cd113
parent8050fe4cf1c4819071163f9f00093f9802e5b7fd (diff)
parent7c27118d72d3d758a3633e999e5cc3bfdac39337 (diff)
downloadinvensense-a98d5eeceed1b037921e8285d5e533191244495f.tar.gz
am 7c27118d: Merge "Fix aosp_manta-userdebug build with clang"
* commit '7c27118d72d3d758a3633e999e5cc3bfdac39337': Fix aosp_manta-userdebug build with clang
-rw-r--r--60xx/libsensors_iio/CompassSensor.IIO.9150.cpp7
-rw-r--r--60xx/libsensors_iio/MPLSensor.cpp17
-rw-r--r--60xx/libsensors_iio/software/core/mpl/gyro_tc.h2
3 files changed, 10 insertions, 16 deletions
diff --git a/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp b/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp
index ce0c5b0..14b92e7 100644
--- a/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp
+++ b/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp
@@ -239,7 +239,7 @@ int CompassSensor::readSample(long *data, int64_t *timestamp)
{
VHANDLER_LOG;
- int numEventReceived = 0, done = 0;
+ int done = 0;
ssize_t n = mCompassInputReader.fill(compass_fd);
if (n < 0) {
@@ -332,10 +332,9 @@ int CompassSensor::inv_init_sysfs_attributes(void)
VFUNC_LOG;
unsigned char i = 0;
- char sysfs_path[MAX_SYSFS_NAME_LEN], iio_trigger_path[MAX_SYSFS_NAME_LEN], tbuf[2];
+ char sysfs_path[MAX_SYSFS_NAME_LEN], iio_trigger_path[MAX_SYSFS_NAME_LEN];
char *sptr;
char **dptr;
- int num;
pathP = (char*)malloc(
sizeof(char[COMPASS_MAX_SYSFS_ATTRB][MAX_SYSFS_NAME_LEN]));
@@ -359,6 +358,8 @@ int CompassSensor::inv_init_sysfs_attributes(void)
inv_get_iio_trigger_path(iio_trigger_path);
#if defined COMPASS_AK8975
+ char tbuf[2];
+ int num;
inv_get_input_number(COMPASS_NAME, &num);
tbuf[0] = num + 0x30;
tbuf[1] = 0;
diff --git a/60xx/libsensors_iio/MPLSensor.cpp b/60xx/libsensors_iio/MPLSensor.cpp
index d88728d..d070231 100644
--- a/60xx/libsensors_iio/MPLSensor.cpp
+++ b/60xx/libsensors_iio/MPLSensor.cpp
@@ -177,12 +177,8 @@ MPLSensor::MPLSensor(CompassSensor *compass, int (*m_pt2AccelCalLoadFunc)(long *
VFUNC_LOG;
inv_error_t rv;
- int i, fd;
- char *port = NULL;
+ int fd;
char *ver_str;
- unsigned long mSensorMask;
- int res;
- FILE *fptr;
mCompassSensor = compass;
@@ -757,7 +753,7 @@ int MPLSensor::onPower(int en)
int res;
- int count, curr_power_state;
+ int curr_power_state;
LOGV_IF(SYSFS_VERBOSE, "HAL:sysfs:echo %d > %s (%lld)",
en, mpu.power_state, getTimestamp());
@@ -1365,7 +1361,6 @@ int MPLSensor::enable(int32_t handle, int en)
// pthread_mutex_lock(&mHALMutex);
if ((uint32_t(newState) << what) != (mEnabled & (1 << what))) {
- uint32_t sensor_type;
short flags = newState;
uint32_t lastEnabled = mEnabled, changed = 0;
@@ -1768,7 +1763,7 @@ int MPLSensor::readAccelEvents(sensors_event_t* /*data*/, int count)
int numEventReceived = 0;
input_event const* event;
- int nb, done = 0;
+ int done = 0;
while (!done && count && mAccelInputReader.readEvent(&event)) {
int type = event->type;
@@ -1858,7 +1853,7 @@ int MPLSensor::readEvents(sensors_event_t* /*data*/, int /*count*/) {
int lp_quaternion_on = 0, nbyte;
- int i, nb, mask = 0, numEventReceived = 0,
+ int i, mask = 0, numEventReceived = 0,
sensors = ((mLocalSensorMask & INV_THREE_AXIS_GYRO)? 1 : 0) +
((mLocalSensorMask & INV_THREE_AXIS_ACCEL)? 1 : 0) +
(((mLocalSensorMask & INV_THREE_AXIS_COMPASS) && mCompassSensor->isIntegrated())? 1 : 0);
@@ -2036,7 +2031,6 @@ int MPLSensor::readCompassEvents(sensors_event_t* /*data*/, int count)
int numEventReceived = 0;
int done = 0;
- int nb;
// pthread_mutex_lock(&mMplMutex);
// pthread_mutex_lock(&mHALMutex);
@@ -2113,7 +2107,7 @@ int MPLSensor::getCompassFd() const
}
int MPLSensor::turnOffAccelFifo() {
- int i, res, tempFd;
+ int i, res;
char *accel_fifo_enable[3] = {mpu.accel_x_fifo_enable,
mpu.accel_y_fifo_enable, mpu.accel_z_fifo_enable};
@@ -2671,7 +2665,6 @@ int MPLSensor::inv_init_sysfs_attributes(void)
char sysfs_path[MAX_SYSFS_NAME_LEN], iio_trigger_path[MAX_SYSFS_NAME_LEN];
char *sptr;
char **dptr;
- int num;
sysfs_names_ptr =
(char*)calloc(1, sizeof(char[MAX_SYSFS_ATTRB][MAX_SYSFS_NAME_LEN]));
diff --git a/60xx/libsensors_iio/software/core/mpl/gyro_tc.h b/60xx/libsensors_iio/software/core/mpl/gyro_tc.h
index 8f1d50e..69918d5 100644
--- a/60xx/libsensors_iio/software/core/mpl/gyro_tc.h
+++ b/60xx/libsensors_iio/software/core/mpl/gyro_tc.h
@@ -11,7 +11,7 @@
*
*****************************************************************************/
-#ifndef _GYRO_TC_H
+#ifndef _GYRO_TC_H_
#define _GYRO_TC_H_
#include "mltypes.h"