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


Groups > linux.kernel > #1709048

Re: [PATCH] imon: constify attribute_group structures

From Sean Young <sean@mess.org>
Newsgroups linux.kernel
Subject Re: [PATCH] imon: constify attribute_group structures
Date 2017-08-11 00:00 +0200
Message-ID <ud3EJ-384-5@gated-at.bofh.it> (permalink)
References <uaWxH-6zQ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 04, 2017 at 09:51:38PM -0400, 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.

I'm afraid the exact same patch has already been submitted before.

http://www.spinics.net/lists/linux-media/msg118090.html


Sean

> 
> File size before:
>  text      data     bss     dec     hex filename
>  36981    16776     960   54717    d5bd drivers/media/rc/imon.o
> 
> File size after:
>  text      data     bss     dec     hex filename
>  37173    16584     960   54717    d5bd drivers/media/rc/imon.o
> 
> This change was made with the help of Coccinelle.
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/media/rc/imon.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
> index bd76534..717ba78 100644
> --- a/drivers/media/rc/imon.c
> +++ b/drivers/media/rc/imon.c
> @@ -911,7 +911,7 @@ static struct attribute *imon_display_sysfs_entries[] = {
>  	NULL
>  };
>  
> -static struct attribute_group imon_display_attr_group = {
> +static const struct attribute_group imon_display_attr_group = {
>  	.attrs = imon_display_sysfs_entries
>  };
>  
> @@ -920,7 +920,7 @@ static struct attribute *imon_rf_sysfs_entries[] = {
>  	NULL
>  };
>  
> -static struct attribute_group imon_rf_attr_group = {
> +static const struct attribute_group imon_rf_attr_group = {
>  	.attrs = imon_rf_sysfs_entries
>  };
>  
> -- 
> 2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] imon: constify attribute_group structures Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2017-08-05 04:00 +0200
  Re: [PATCH] imon: constify attribute_group structures Sean Young <sean@mess.org> - 2017-08-11 00:00 +0200

csiph-web