[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <aa224b3cc923fdbb3edd0c41b2c639c85408c9e8.1498737347.git.arvind.yadav.cs@gmail.com>
Date: Thu, 29 Jun 2017 17:31:09 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: rmk+kernel@....linux.org.uk, keescook@...omium.org,
akpm@...ux-foundation.org, dyoung@...hat.com,
hbathini@...ux.vnet.ibm.com
Cc: ptesarik@...e.com, linux-kernel@...r.kernel.org
Subject: [PATCH] kernel: ksysfs: constify attribute_group structures.
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
1120 544 16 1680 690 kernel/ksysfs.o
File size After adding 'const':
text data bss dec hex filename
1160 480 16 1656 678 kernel/ksysfs.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
kernel/ksysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 23cd706..df1a9aa 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -234,7 +234,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj,
NULL
};
-static struct attribute_group kernel_attr_group = {
+static const struct attribute_group kernel_attr_group = {
.attrs = kernel_attrs,
};
--
1.9.1
Powered by blists - more mailing lists