summaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
diff options
context:
space:
mode:
authorColin Ian King2017-08-30 13:16:16 +0200
committerJonathan Cameron2017-09-03 19:10:32 +0200
commit2711e642baba386bc83e49b9d1c52c92d4393a63 (patch)
tree12fddfd5f1cab389b7ec9efcf63e4c32219e71da /drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
parentiio: adc: ti-ads1015: add 10% to conversion wait time (diff)
downloadkernel-qcow2-linux-2711e642baba386bc83e49b9d1c52c92d4393a63.tar.gz
kernel-qcow2-linux-2711e642baba386bc83e49b9d1c52c92d4393a63.tar.xz
kernel-qcow2-linux-2711e642baba386bc83e49b9d1c52c92d4393a63.zip
iio: imu: inv_mpu6050: make arrays hz and d static
Don't populate the arrays on the stack, instead make them static. Makes the object code smaller by 135 bytes: Before: text data bss dec hex filename 15135 4240 128 19503 4c2f inv_mpu_core.o After: text data bss dec hex filename 14840 4400 128 19368 4ba8 inv_mpu_core.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/inv_mpu6050/inv_mpu_core.c')
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 097ce1fd6f69..7d64be353403 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -572,10 +572,12 @@ error_write_raw_unlock:
*/
static int inv_mpu6050_set_lpf(struct inv_mpu6050_state *st, int rate)
{
- const int hz[] = {188, 98, 42, 20, 10, 5};
- const int d[] = {INV_MPU6050_FILTER_188HZ, INV_MPU6050_FILTER_98HZ,
- INV_MPU6050_FILTER_42HZ, INV_MPU6050_FILTER_20HZ,
- INV_MPU6050_FILTER_10HZ, INV_MPU6050_FILTER_5HZ};
+ static const int hz[] = {188, 98, 42, 20, 10, 5};
+ static const int d[] = {
+ INV_MPU6050_FILTER_188HZ, INV_MPU6050_FILTER_98HZ,
+ INV_MPU6050_FILTER_42HZ, INV_MPU6050_FILTER_20HZ,
+ INV_MPU6050_FILTER_10HZ, INV_MPU6050_FILTER_5HZ
+ };
int i, h, result;
u8 data;