All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: constify attribute_group structures.
@ 2017-07-03 10:10 ` Arvind Yadav
  2017-07-03 10:17   ` Chanwoo Choi
       [not found]   ` <CGME20170703101025epcas4p151a0c496ae3410031c27f4da7ab9714f@epcms1p3>
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-07-03 10:10 UTC (permalink / raw)
  To: myungjoo.ham, kyungmin.park, cw00.choi; +Cc: linux-pm, linux-kernel

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work with const
attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
    621	    176	      0	    797	    31d	drivers/devfreq/governor_userspace.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   670	    144	      0	    814	    32e	drivers/devfreq/governor_userspace.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/devfreq/governor_userspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
index 1769760..77028c2 100644
--- a/drivers/devfreq/governor_userspace.c
+++ b/drivers/devfreq/governor_userspace.c
@@ -86,7 +86,7 @@ static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
 	&dev_attr_set_freq.attr,
 	NULL,
 };
-static struct attribute_group dev_attr_group = {
+static const struct attribute_group dev_attr_group = {
 	.name	= "userspace",
 	.attrs	= dev_entries,
 };
-- 
1.9.1

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

* Re: [PATCH] PM / devfreq: constify attribute_group structures.
  2017-07-03 10:10 ` [PATCH] PM / devfreq: constify attribute_group structures Arvind Yadav
@ 2017-07-03 10:17   ` Chanwoo Choi
       [not found]   ` <CGME20170703101025epcas4p151a0c496ae3410031c27f4da7ab9714f@epcms1p3>
  1 sibling, 0 replies; 3+ messages in thread
From: Chanwoo Choi @ 2017-07-03 10:17 UTC (permalink / raw)
  To: Arvind Yadav, myungjoo.ham, kyungmin.park; +Cc: linux-pm, linux-kernel

On 2017년 07월 03일 19:10, Arvind Yadav wrote:
> attribute_groups are not supposed to change at runtime. All functions
> working with attribute_groups provided by <linux/sysfs.h> work with const
> attribute_group. So mark the non-const structs as const.
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>     621	    176	      0	    797	    31d	drivers/devfreq/governor_userspace.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    670	    144	      0	    814	    32e	drivers/devfreq/governor_userspace.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/devfreq/governor_userspace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
> index 1769760..77028c2 100644
> --- a/drivers/devfreq/governor_userspace.c
> +++ b/drivers/devfreq/governor_userspace.c
> @@ -86,7 +86,7 @@ static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
>  	&dev_attr_set_freq.attr,
>  	NULL,
>  };
> -static struct attribute_group dev_attr_group = {
> +static const struct attribute_group dev_attr_group = {
>  	.name	= "userspace",
>  	.attrs	= dev_entries,
>  };
> 

Looks good to me.
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

* RE: Re: [PATCH] PM / devfreq: constify attribute_group structures.
       [not found]   ` <CGME20170703101025epcas4p151a0c496ae3410031c27f4da7ab9714f@epcms1p3>
@ 2017-07-06  1:39     ` MyungJoo Ham
  0 siblings, 0 replies; 3+ messages in thread
From: MyungJoo Ham @ 2017-07-06  1:39 UTC (permalink / raw)
  To: Chanwoo Choi, Arvind Yadav, Kyungmin Park; +Cc: linux-pm, linux-kernel

> On 2017년 07월 03일 19:10, Arvind Yadav wrote:

> > attribute_groups are not supposed to change at runtime. All functions

> > working with attribute_groups provided by <linux/sysfs.h> work with const

> > attribute_group. So mark the non-const structs as const.

> > 

> > File size before:

> >    text	   data	    bss	    dec	    hex	filename

> >     621	    176	      0	    797	    31d	drivers/devfreq/governor_userspace.o

> > 

> > File size After adding 'const':

> >    text	   data	    bss	    dec	    hex	filename

> >    670	    144	      0	    814	    32e	drivers/devfreq/governor_userspace.o

> > 

> > Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

> > ---

> >  drivers/devfreq/governor_userspace.c | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > 

> > diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c

[]

> 

> Looks good to me.

> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>



Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>



Thank you. Applying to for-rc branch.





Cheers,

MyungJoo

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

end of thread, other threads:[~2017-07-06  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170703101025epcas4p151a0c496ae3410031c27f4da7ab9714f@epcas4p1.samsung.com>
2017-07-03 10:10 ` [PATCH] PM / devfreq: constify attribute_group structures Arvind Yadav
2017-07-03 10:17   ` Chanwoo Choi
     [not found]   ` <CGME20170703101025epcas4p151a0c496ae3410031c27f4da7ab9714f@epcms1p3>
2017-07-06  1:39     ` MyungJoo Ham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.