lkml.org 
[lkml]   [2017]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PM / devfreq: constify attribute_group structures.
Date
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
\
 
 \ /
  Last update: 2017-07-03 12:11    [W:0.045 / U:39.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site