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


Groups > linux.kernel > #1696649 > unrolled thread

[PATCH] staging: unisys: visorbus_main: constify attribute_group structures

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

Back to article view | Back to linux.kernel


Contents

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

#1696649 — [PATCH] staging: unisys: visorbus_main: constify attribute_group structures

FromAmitoj Kaur Chawla <amitoj1606@gmail.com>
Date2017-07-26 00:50 +0200
Subject[PATCH] staging: unisys: visorbus_main: constify attribute_group structures
Message-ID<u7gOm-s4-21@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
 14216    7304     832   22352    5750
drivers/staging/unisys/visorbus/visorbus_main.o

File size after:
 text     data     bss     dec     hex filename
 14408    7112     832   22352    5750
drivers/staging/unisys/visorbus/visorbus_main.o

This change was made with the help of Coccinelle.

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

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd..bba10dc 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,7 @@ static struct attribute *channel_attrs[] = {
 		NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
 		.name = "channel",
 		.attrs = channel_attrs,
 };
@@ -340,7 +340,7 @@ static struct attribute *dev_attrs[] = {
 		NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
 		.attrs = dev_attrs,
 };
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1698459

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-07-28 06:40 +0200
Message-ID<u85e9-7ox-5@gated-at.bofh.it>
In reply to#1696649
On Tue, Jul 25, 2017 at 06:45:52PM -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
>  14216    7304     832   22352    5750
> drivers/staging/unisys/visorbus/visorbus_main.o
> 
> File size after:
>  text     data     bss     dec     hex filename
>  14408    7112     832   22352    5750
> drivers/staging/unisys/visorbus/visorbus_main.o
> 
> This change was made with the help of Coccinelle.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
> index 1c785dd..bba10dc 100644
> --- a/drivers/staging/unisys/visorbus/visorbus_main.c
> +++ b/drivers/staging/unisys/visorbus/visorbus_main.c
> @@ -249,7 +249,7 @@ static struct attribute *channel_attrs[] = {
>  		NULL
>  };
>  
> -static struct attribute_group channel_attr_grp = {
> +static const struct attribute_group channel_attr_grp = {
>  		.name = "channel",
>  		.attrs = channel_attrs,
>  };
> @@ -340,7 +340,7 @@ static struct attribute *dev_attrs[] = {
>  		NULL
>  };
>  
> -static struct attribute_group dev_attr_grp = {
> +static const struct attribute_group dev_attr_grp = {
>  		.attrs = dev_attrs,
>  };
>  

Does not apply to my tree :(

sorry,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web