linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] leds: blinkm: constify attribute_group structure
@ 2017-08-10 16:28 Amitoj Kaur Chawla
  2017-08-14 20:47 ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ 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/sysfs.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
 8657      3496      64   12217    2fb9 drivers/leds/leds-blinkm.o

File size after:
 text      data     bss     dec     hex filename
 8753      3400      64   12217    2fb9 drivers/leds/leds-blinkm.o

This change was made with the help of Coccinelle.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/leds/leds-blinkm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c
index 617fe97..d03ed6b 100644
--- a/drivers/leds/leds-blinkm.c
+++ b/drivers/leds/leds-blinkm.c
@@ -298,7 +298,7 @@ static struct attribute *blinkm_attrs[] = {
 	NULL,
 };
 
-static struct attribute_group blinkm_group = {
+static const struct attribute_group blinkm_group = {
 	.name = "blinkm",
 	.attrs = blinkm_attrs,
 };
-- 
2.7.4

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

* Re: [PATCH 1/2] leds: blinkm: constify attribute_group structure
  2017-08-10 16:28 [PATCH 1/2] leds: blinkm: constify attribute_group structure Amitoj Kaur Chawla
@ 2017-08-14 20:47 ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2017-08-14 20:47 UTC (permalink / raw)
  To: Amitoj Kaur Chawla, rpurdie, pavel, linux-leds, linux-kernel

Hi Amitoj,

Similar patch is already queued in the for-next branch
of linux-leds.git.

Thanks,
Jacek Anaszewski

On 08/10/2017 06:28 PM, Amitoj Kaur Chawla wrote:
> Functions working with attribute_groups provided by <linux/sysfs.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
>  8657      3496      64   12217    2fb9 drivers/leds/leds-blinkm.o
> 
> File size after:
>  text      data     bss     dec     hex filename
>  8753      3400      64   12217    2fb9 drivers/leds/leds-blinkm.o
> 
> This change was made with the help of Coccinelle.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/leds/leds-blinkm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/leds-blinkm.c b/drivers/leds/leds-blinkm.c
> index 617fe97..d03ed6b 100644
> --- a/drivers/leds/leds-blinkm.c
> +++ b/drivers/leds/leds-blinkm.c
> @@ -298,7 +298,7 @@ static struct attribute *blinkm_attrs[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group blinkm_group = {
> +static const struct attribute_group blinkm_group = {
>  	.name = "blinkm",
>  	.attrs = blinkm_attrs,
>  };
> 

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 16:28 [PATCH 1/2] leds: blinkm: constify attribute_group structure Amitoj Kaur Chawla
2017-08-14 20:47 ` Jacek Anaszewski

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