Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752645AbdF2MBd (ORCPT ); Thu, 29 Jun 2017 08:01:33 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36807 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbdF2MB2 (ORCPT ); Thu, 29 Jun 2017 08:01:28 -0400 From: Arvind Yadav To: rmk+kernel@arm.linux.org.uk, keescook@chromium.org, akpm@linux-foundation.org, dyoung@redhat.com, hbathini@linux.vnet.ibm.com Cc: ptesarik@suse.com, linux-kernel@vger.kernel.org Subject: [PATCH] kernel: ksysfs: constify attribute_group structures. Date: Thu, 29 Jun 2017 17:31:09 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 970 Lines: 32 attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by 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 --- 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