linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Colin King <colin.king@canonical.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Jean-Baptiste Maneyrol <JManeyrol@invensense.com>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: imu: inv_mpu6050: make arrays hz and d static
Date: Sun, 3 Sep 2017 17:41:35 +0100	[thread overview]
Message-ID: <20170903174135.2ad75bf8@archlinux> (raw)
In-Reply-To: <20170830111616.27559-1-colin.king@canonical.com>

On Wed, 30 Aug 2017 12:16:16 +0100
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
Applied to the togreg branch of iio.git and pushed out as
testing or the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 10 ++++++----
>  1 file 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 44830bce13df..6692f5e08dc8 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> @@ -570,10 +570,12 @@ static int inv_mpu6050_write_raw(struct iio_dev *indio_dev,
>   */
>  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;
>  


      reply	other threads:[~2017-09-03 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 11:16 [PATCH] iio: imu: inv_mpu6050: make arrays hz and d static Colin King
2017-09-03 16:41 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170903174135.2ad75bf8@archlinux \
    --to=jic23@kernel.org \
    --cc=JManeyrol@invensense.com \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).