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


Groups > linux.kernel > #1711434 > unrolled thread

Re: [PATCH 2/2] leds: lm3533: constify attribute_group structure

Started byJacek Anaszewski <jacek.anaszewski@gmail.com>
First post2017-08-14 22:50 +0200
Last post2017-08-14 22:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/2] leds: lm3533: constify attribute_group structure Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2017-08-14 22:50 +0200

#1711434 — Re: [PATCH 2/2] leds: lm3533: constify attribute_group structure

FromJacek Anaszewski <jacek.anaszewski@gmail.com>
Date2017-08-14 22:50 +0200
SubjectRe: [PATCH 2/2] leds: lm3533: constify attribute_group structure
Message-ID<ueutc-n0-9@gated-at.bofh.it>
Hi Amitoj,

Thanks for the patch, applied.

Best regards,
Jacek Anaszewski

On 08/10/2017 06:28 PM, Amitoj Kaur Chawla wrote:
> Functions working with attribute_groups provided by <linux/device.h>
> work with const attribute_group. These attribute_group structures do not
> change at runtime so mark them as const.
> 
> File size before:
>  text      data     bss     dec     hex filename
>  8272      4608      64   12944    3290 drivers/leds/leds-lm3533.o
> 
> File size after:
>  text      data     bss     dec     hex filename
>  8368      4512      64   12944    3290 drivers/leds/leds-lm3533.o
> 
> This change was made with the help of Coccinelle.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/leds/leds-lm3533.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c
> index 5b529dc..72224b5 100644
> --- a/drivers/leds/leds-lm3533.c
> +++ b/drivers/leds/leds-lm3533.c
> @@ -626,7 +626,7 @@ static umode_t lm3533_led_attr_is_visible(struct kobject *kobj,
>  	return mode;
>  };
>  
> -static struct attribute_group lm3533_led_attribute_group = {
> +static const struct attribute_group lm3533_led_attribute_group = {
>  	.is_visible	= lm3533_led_attr_is_visible,
>  	.attrs		= lm3533_led_attributes
>  };
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web