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


Groups > linux.kernel > #1697654 > unrolled thread

[PATCH] staging: unisys: visorchipset: constify attribute_group structure

Started byAmitoj Kaur Chawla <amitoj1606@gmail.com>
First post2017-07-27 04:00 +0200
Last post2017-07-28 06:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: unisys: visorchipset: constify attribute_group  structure Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2017-07-27 04:00 +0200
    Re: [PATCH] staging: unisys: visorchipset: constify attribute_group  structure Greg KH <gregkh@linuxfoundation.org> - 2017-07-28 06:40 +0200

#1697654 — [PATCH] staging: unisys: visorchipset: constify attribute_group structure

FromAmitoj Kaur Chawla <amitoj1606@gmail.com>
Date2017-07-27 04:00 +0200
Subject[PATCH] staging: unisys: visorchipset: constify attribute_group structure
Message-ID<u7GfL-88U-7@gated-at.bofh.it>
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
 24124     6216     448   30788    7844
drivers/staging/unisys/visorbus/visorchipset.o

File size after:
 text     data     bss     dec     hex filename
 24220    6120     448   30788    7844
drivers/staging/unisys/visorbus/visorchipset.o

This change was made with the help of Coccinelle.

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

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 2215056..798a92e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1146,7 +1146,7 @@ static struct attribute *visorchipset_parahotplug_attrs[] = {
 	NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
 	.name = "parahotplug",
 	.attrs = visorchipset_parahotplug_attrs
 };
-- 
2.7.4

[toc] | [next] | [standalone]


#1698460

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-07-28 06:40 +0200
Message-ID<u85e9-7ox-7@gated-at.bofh.it>
In reply to#1697654
On Wed, Jul 26, 2017 at 09:51:32PM -0400, 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
>  24124     6216     448   30788    7844
> drivers/staging/unisys/visorbus/visorchipset.o
> 
> File size after:
>  text     data     bss     dec     hex filename
>  24220    6120     448   30788    7844
> drivers/staging/unisys/visorbus/visorchipset.o
> 
> This change was made with the help of Coccinelle.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
> index 2215056..798a92e 100644
> --- a/drivers/staging/unisys/visorbus/visorchipset.c
> +++ b/drivers/staging/unisys/visorbus/visorchipset.c
> @@ -1146,7 +1146,7 @@ static struct attribute *visorchipset_parahotplug_attrs[] = {
>  	NULL
>  };
>  
> -static struct attribute_group visorchipset_parahotplug_group = {
> +static const struct attribute_group visorchipset_parahotplug_group = {
>  	.name = "parahotplug",
>  	.attrs = visorchipset_parahotplug_attrs
>  };

Someone else sent this change right before you did :(

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web