Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934310AbdGTHWl (ORCPT ); Thu, 20 Jul 2017 03:22:41 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34049 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934281AbdGTHWg (ORCPT ); Thu, 20 Jul 2017 03:22:36 -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 3/7] perf: x86: intel: uncore_snb: constify attribute_group structures. Date: Thu, 20 Jul 2017 12:51:41 +0530 Message-Id: <1500535305-9369-4-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500535305-9369-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1500535305-9369-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: 1681 Lines: 50 attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by 'uncore.h' work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 4158 4792 0 8950 22f6 arch/x86/events/intel/uncore_snb.o File size After adding 'const': text data bss dec hex filename 4350 4600 0 8950 22f6 arch/x86/events/intel/uncore_snb.o Signed-off-by: Arvind Yadav --- arch/x86/events/intel/uncore_snb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/events/intel/uncore_snb.c b/arch/x86/events/intel/uncore_snb.c index a3dcc12..db1127c 100644 --- a/arch/x86/events/intel/uncore_snb.c +++ b/arch/x86/events/intel/uncore_snb.c @@ -130,7 +130,7 @@ static void snb_uncore_msr_exit_box(struct intel_uncore_box *box) NULL, }; -static struct attribute_group snb_uncore_format_group = { +static const struct attribute_group snb_uncore_format_group = { .name = "format", .attrs = snb_uncore_formats_attr, }; @@ -289,7 +289,7 @@ enum { NULL, }; -static struct attribute_group snb_uncore_imc_format_group = { +static const struct attribute_group snb_uncore_imc_format_group = { .name = "format", .attrs = snb_uncore_imc_formats_attr, }; @@ -769,7 +769,7 @@ static void nhm_uncore_msr_enable_event(struct intel_uncore_box *box, struct per NULL, }; -static struct attribute_group nhm_uncore_format_group = { +static const struct attribute_group nhm_uncore_format_group = { .name = "format", .attrs = nhm_uncore_formats_attr, }; -- 1.9.1