Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719546

Re: [PATCH 1/4] leds: aat1290: make array max_mm_current_percent static const

From Jacek Anaszewski <jacek.anaszewski@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] leds: aat1290: make array max_mm_current_percent static const
Date 2017-08-24 22:40 +0200
Message-ID <ui750-2Q6-9@gated-at.bofh.it> (permalink)
References <ui03w-70q-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Colin,

Thanks for the path set, applied.

Best regards,
Jacek Anaszewski

On 08/24/2017 03:00 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array max_mm_current_percent on the stack, instead
> make it static const.  Makes the object code smaller by over 280 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>    7225	   1936	     64	   9225	   2409	./drivers/leds/leds-aat1290.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>    6847	   2032	     64	   8943	   22ef	./drivers/leds/leds-aat1290.o`
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/leds/leds-aat1290.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/leds/leds-aat1290.c b/drivers/leds/leds-aat1290.c
> index a21e19297745..35fcb0ca9092 100644
> --- a/drivers/leds/leds-aat1290.c
> +++ b/drivers/leds/leds-aat1290.c
> @@ -314,8 +314,10 @@ static void aat1290_led_validate_mm_current(struct aat1290_led *led,
>  static int init_mm_current_scale(struct aat1290_led *led,
>  			struct aat1290_led_config_data *cfg)
>  {
> -	int max_mm_current_percent[] = { 20, 22, 25, 28, 32, 36, 40, 45, 50, 56,
> -						63, 71, 79, 89, 100 };
> +	static const int max_mm_current_percent[] = {
> +		20, 22, 25, 28, 32, 36, 40, 45, 50, 56,
> +		63, 71, 79, 89, 100
> +	};
>  	int i, max_mm_current =
>  			AAT1290_MAX_MM_CURRENT(cfg->max_flash_current);
>  
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] leds: aat1290: make array max_mm_current_percent static const Colin King <colin.king@canonical.com> - 2017-08-24 15:10 +0200
  [PATCH 4/4] leds: lp8501: make several arrays static const Colin King <colin.king@canonical.com> - 2017-08-24 15:10 +0200
  [PATCH 2/4] leds: lp5521: make several arrays static const Colin King <colin.king@canonical.com> - 2017-08-24 15:10 +0200
  Re: [PATCH 1/4] leds: aat1290: make array max_mm_current_percent  static const Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2017-08-24 22:40 +0200

csiph-web