linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Colin King <colin.king@canonical.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: make array ch_to_mux static, makes object code smaller
Date: Sat, 21 Oct 2017 17:58:09 +0100	[thread overview]
Message-ID: <20171021175809.3e036d39@archlinux> (raw)
In-Reply-To: <20171019134622.31712-1-colin.king@canonical.com>

On Thu, 19 Oct 2017 15:46:22 +0200
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate const array ch_to_mux on the stack, instead
> make it static. Makes the object code smaller by over 200 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   12663	   1648	    128	  14439	   3867	drivers/iio/adc/ti-adc12138.o
> 
> After
>    text	   data	    bss	    dec	    hex	filename
>   12353	   1744	    128	  14225	   3791	drivers/iio/adc/ti-adc12138.o
> 
> (gcc version 7.2.0 x86_64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks.  I added the driver name to the title though as people tend
to scan lists of commits to see if there is anything they care about
and this only effects on driver rather than all adcs.

Applied to the togreg branch of iio.git and pusehd out as testing for the
autobuilders to play with it.

thanks,

Jonathan
> ---
>  drivers/iio/adc/ti-adc12138.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-adc12138.c b/drivers/iio/adc/ti-adc12138.c
> index bf890244789a..703d68ae96b7 100644
> --- a/drivers/iio/adc/ti-adc12138.c
> +++ b/drivers/iio/adc/ti-adc12138.c
> @@ -164,7 +164,7 @@ static int __adc12138_start_conv(struct adc12138 *adc,
>  				 void *data, int len)
>  
>  {
> -	const u8 ch_to_mux[] = { 0, 4, 1, 5, 2, 6, 3, 7 };
> +	static const u8 ch_to_mux[] = { 0, 4, 1, 5, 2, 6, 3, 7 };
>  	u8 mode = (ch_to_mux[channel->channel] << 4) |
>  		  (channel->differential ? 0 : 0x80);
>  


      reply	other threads:[~2017-10-21 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 13:46 [PATCH] iio: adc: make array ch_to_mux static, makes object code smaller Colin King
2017-10-21 16:58 ` 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=20171021175809.3e036d39@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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).