Linux LED subsystem development
 help / color / mirror / Atom feed
* [PATCH 2/2] leds: lm3533: constify attribute_group structure
@ 2017-08-10 16:28 Amitoj Kaur Chawla
  2017-08-11 12:34 ` Pavel Machek
  2017-08-14 20:46 ` Jacek Anaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Amitoj Kaur Chawla @ 2017-08-10 16:28 UTC (permalink / raw)
  To: rpurdie, jacek.anaszewski, pavel, linux-leds, linux-kernel

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
 };
-- 
2.7.4

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

* Re: [PATCH 2/2] leds: lm3533: constify attribute_group structure
  2017-08-10 16:28 [PATCH 2/2] leds: lm3533: constify attribute_group structure Amitoj Kaur Chawla
@ 2017-08-11 12:34 ` Pavel Machek
  2017-08-14 20:46 ` Jacek Anaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2017-08-11 12:34 UTC (permalink / raw)
  To: Amitoj Kaur Chawla; +Cc: rpurdie, jacek.anaszewski, linux-leds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

On Thu 2017-08-10 12:28:09, 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>

patches 1,2:

Acked-by: Pavel Machek <pavel@ucw.cz>

								Pavel

> -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
>  };

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [PATCH 2/2] leds: lm3533: constify attribute_group structure
  2017-08-10 16:28 [PATCH 2/2] leds: lm3533: constify attribute_group structure Amitoj Kaur Chawla
  2017-08-11 12:34 ` Pavel Machek
@ 2017-08-14 20:46 ` Jacek Anaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Jacek Anaszewski @ 2017-08-14 20:46 UTC (permalink / raw)
  To: Amitoj Kaur Chawla, rpurdie, pavel, linux-leds, linux-kernel

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
>  };
> 

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

end of thread, other threads:[~2017-08-14 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 16:28 [PATCH 2/2] leds: lm3533: constify attribute_group structure Amitoj Kaur Chawla
2017-08-11 12:34 ` Pavel Machek
2017-08-14 20:46 ` Jacek Anaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox