kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static to reduce code size
@ 2017-07-07 16:08 Colin King
  2017-07-09 18:14 ` Jonathan Cameron
  2017-07-10 16:56 ` [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static Colin King
  0 siblings, 2 replies; 5+ messages in thread
From: Colin King @ 2017-07-07 16:08 UTC (permalink / raw)
  To: Ludovic Desroches, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-iio
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Making the const array startup_lookup static rather having it on the
stack saves 69 bytes. Add in missing int specifier to clean up a
checkpatch warning.

Before:
   text	   data	    bss	    dec	    hex	filename
  10297	   2800	    128	  13225	   33a9	drivers/iio/adc/at91-sama5d2_adc.o

After:
   text	   data	    bss	    dec	    hex	filename
  10140	   2888	    128	  13156	   3364	drivers/iio/adc/at91-sama5d2_adc.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index e10dca3ed74b..509988a6817a 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -231,7 +231,7 @@ static const struct iio_chan_spec at91_adc_channels[] = {
 static unsigned at91_adc_startup_time(unsigned startup_time_min,
 				      unsigned adc_clk_khz)
 {
-	const unsigned startup_lookup[] = {
+	static const unsigned int startup_lookup[] = {
 		  0,   8,  16,  24,
 		 64,  80,  96, 112,
 		512, 576, 640, 704,
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static to reduce code size
  2017-07-07 16:08 [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static to reduce code size Colin King
@ 2017-07-09 18:14 ` Jonathan Cameron
  2017-07-10 16:56 ` [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static Colin King
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2017-07-09 18:14 UTC (permalink / raw)
  To: Colin King
  Cc: Ludovic Desroches, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors, linux-kernel

On Fri,  7 Jul 2017 17:08:35 +0100
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Making the const array startup_lookup static rather having it on the
> stack saves 69 bytes. Add in missing int specifier to clean up a
> checkpatch warning.
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   10297	   2800	    128	  13225	   33a9	drivers/iio/adc/at91-sama5d2_adc.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   10140	   2888	    128	  13156	   3364	drivers/iio/adc/at91-sama5d2_adc.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to the togreg branch of iio.git and pushed out as testing.

Thanks,

Jonathan
> ---
>  drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> index e10dca3ed74b..509988a6817a 100644
> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> @@ -231,7 +231,7 @@ static const struct iio_chan_spec at91_adc_channels[] = {
>  static unsigned at91_adc_startup_time(unsigned startup_time_min,
>  				      unsigned adc_clk_khz)
>  {
> -	const unsigned startup_lookup[] = {
> +	static const unsigned int startup_lookup[] = {
>  		  0,   8,  16,  24,
>  		 64,  80,  96, 112,
>  		512, 576, 640, 704,


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static
  2017-07-07 16:08 [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static to reduce code size Colin King
  2017-07-09 18:14 ` Jonathan Cameron
@ 2017-07-10 16:56 ` Colin King
  2017-07-10 20:59   ` Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Colin King @ 2017-07-10 16:56 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate array startup_lookup on the stack but instead make
it static.  Makes the object code smaller.  Also add in missing 'int' type
specifier to clean up a checkpatch warning.

Before:
   text	   data	    bss	    dec	    hex	filename
  10297	   2800	    128	  13225	   33a9	drivers/iio/adc/at91-sama5d2_adc.o

After:
   text	   data	    bss	    dec	    hex	filename
  10140	   2888	    128	  13156	   3364	drivers/iio/adc/at91-sama5d2_adc.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index e10dca3ed74b..509988a6817a 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -231,7 +231,7 @@ static const struct iio_chan_spec at91_adc_channels[] = {
 static unsigned at91_adc_startup_time(unsigned startup_time_min,
 				      unsigned adc_clk_khz)
 {
-	const unsigned startup_lookup[] = {
+	static const unsigned int startup_lookup[] = {
 		  0,   8,  16,  24,
 		 64,  80,  96, 112,
 		512, 576, 640, 704,
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static
  2017-07-10 16:56 ` [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static Colin King
@ 2017-07-10 20:59   ` Jonathan Cameron
  2017-07-10 21:34     ` Colin Ian King
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2017-07-10 20:59 UTC (permalink / raw)
  To: Colin King
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors, linux-kernel

On Mon, 10 Jul 2017 17:56:16 +0100
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate array startup_lookup on the stack but instead make
> it static.  Makes the object code smaller.  Also add in missing 'int' type
> specifier to clean up a checkpatch warning.
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   10297	   2800	    128	  13225	   33a9	drivers/iio/adc/at91-sama5d2_adc.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   10140	   2888	    128	  13156	   3364	drivers/iio/adc/at91-sama5d2_adc.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Hi Colin

I'm guessing accidental repost?  I applied this yesterday and you haven't marked
it as a resend!

Jonathan
> ---
>  drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> index e10dca3ed74b..509988a6817a 100644
> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> @@ -231,7 +231,7 @@ static const struct iio_chan_spec at91_adc_channels[] = {
>  static unsigned at91_adc_startup_time(unsigned startup_time_min,
>  				      unsigned adc_clk_khz)
>  {
> -	const unsigned startup_lookup[] = {
> +	static const unsigned int startup_lookup[] = {
>  		  0,   8,  16,  24,
>  		 64,  80,  96, 112,
>  		512, 576, 640, 704,


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static
  2017-07-10 20:59   ` Jonathan Cameron
@ 2017-07-10 21:34     ` Colin Ian King
  0 siblings, 0 replies; 5+ messages in thread
From: Colin Ian King @ 2017-07-10 21:34 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors, linux-kernel

On 10/07/17 21:59, Jonathan Cameron wrote:
> On Mon, 10 Jul 2017 17:56:16 +0100
> Colin King <colin.king@canonical.com> wrote:
> 
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Don't populate array startup_lookup on the stack but instead make
>> it static.  Makes the object code smaller.  Also add in missing 'int' type
>> specifier to clean up a checkpatch warning.
>>
>> Before:
>>    text	   data	    bss	    dec	    hex	filename
>>   10297	   2800	    128	  13225	   33a9	drivers/iio/adc/at91-sama5d2_adc.o
>>
>> After:
>>    text	   data	    bss	    dec	    hex	filename
>>   10140	   2888	    128	  13156	   3364	drivers/iio/adc/at91-sama5d2_adc.o
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Hi Colin
> 
> I'm guessing accidental repost?  I applied this yesterday and you haven't marked
> it as a resend!

Yes, sorry, I lost track of what I was working on. Apologies.

> 
> Jonathan
>> ---
>>  drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
>> index e10dca3ed74b..509988a6817a 100644
>> --- a/drivers/iio/adc/at91-sama5d2_adc.c
>> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
>> @@ -231,7 +231,7 @@ static const struct iio_chan_spec at91_adc_channels[] = {
>>  static unsigned at91_adc_startup_time(unsigned startup_time_min,
>>  				      unsigned adc_clk_khz)
>>  {
>> -	const unsigned startup_lookup[] = {
>> +	static const unsigned int startup_lookup[] = {
>>  		  0,   8,  16,  24,
>>  		 64,  80,  96, 112,
>>  		512, 576, 640, 704,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-10 21:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 16:08 [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static to reduce code size Colin King
2017-07-09 18:14 ` Jonathan Cameron
2017-07-10 16:56 ` [PATCH] iio:adc:at91-sama5d2: make array startup_lookup static Colin King
2017-07-10 20:59   ` Jonathan Cameron
2017-07-10 21:34     ` Colin Ian King

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).