Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965328AbdGTLbg (ORCPT ); Thu, 20 Jul 2017 07:31:36 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34612 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936035AbdGTLbe (ORCPT ); Thu, 20 Jul 2017 07:31:34 -0400 From: Arvind Yadav To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, bp@alien8.de, tony.luck@intel.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] x86: ksysfs: constify attribute_group structures. Date: Thu, 20 Jul 2017 17:00:36 +0530 Message-Id: <1500550238-15655-6-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500550238-15655-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1500550238-15655-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 36 attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav --- change in v2: Remove before/after size comparison from commit message. arch/x86/kernel/ksysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/ksysfs.c b/arch/x86/kernel/ksysfs.c index 4afc67f..06e1ff5 100644 --- a/arch/x86/kernel/ksysfs.c +++ b/arch/x86/kernel/ksysfs.c @@ -55,7 +55,7 @@ static ssize_t boot_params_data_read(struct file *fp, struct kobject *kobj, NULL, }; -static struct attribute_group boot_params_attr_group = { +static const struct attribute_group boot_params_attr_group = { .attrs = boot_params_version_attrs, .bin_attrs = boot_params_data_attrs, }; @@ -202,7 +202,7 @@ static ssize_t setup_data_data_read(struct file *fp, NULL, }; -static struct attribute_group setup_data_attr_group = { +static const struct attribute_group setup_data_attr_group = { .attrs = setup_data_type_attrs, .bin_attrs = setup_data_data_attrs, }; -- 1.9.1