Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692495 > unrolled thread

[PATCH 2/7] perf: x86: intel: uncore_nhmex: constify attribute_group structures.

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-07-20 09:30 +0200
Last post2017-07-20 09:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/7] perf: x86: intel: uncore_nhmex: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-20 09:30 +0200

#1692495 — [PATCH 2/7] perf: x86: intel: uncore_nhmex: constify attribute_group structures.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-07-20 09:30 +0200
Subject[PATCH 2/7] perf: x86: intel: uncore_nhmex: constify attribute_group structures.
Message-ID<u5e4i-41p-25@gated-at.bofh.it>
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
   8236	   5992	      1	  14229	   3795	x86/events/intel/uncore_nhmex.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   8620	   5608	      1	  14229	   3795	x86/events/intel/uncore_nhmex.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 arch/x86/events/intel/uncore_nhmex.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/events/intel/uncore_nhmex.c b/arch/x86/events/intel/uncore_nhmex.c
index cda5693..6a5cbe9 100644
--- a/arch/x86/events/intel/uncore_nhmex.c
+++ b/arch/x86/events/intel/uncore_nhmex.c
@@ -272,7 +272,7 @@ static void nhmex_uncore_msr_enable_event(struct intel_uncore_box *box, struct p
 	NULL,
 };
 
-static struct attribute_group nhmex_uncore_ubox_format_group = {
+static const struct attribute_group nhmex_uncore_ubox_format_group = {
 	.name		= "format",
 	.attrs		= nhmex_uncore_ubox_formats_attr,
 };
@@ -299,7 +299,7 @@ static void nhmex_uncore_msr_enable_event(struct intel_uncore_box *box, struct p
 	NULL,
 };
 
-static struct attribute_group nhmex_uncore_cbox_format_group = {
+static const struct attribute_group nhmex_uncore_cbox_format_group = {
 	.name = "format",
 	.attrs = nhmex_uncore_cbox_formats_attr,
 };
@@ -407,7 +407,7 @@ static void nhmex_bbox_msr_enable_event(struct intel_uncore_box *box, struct per
 	NULL,
 };
 
-static struct attribute_group nhmex_uncore_bbox_format_group = {
+static const struct attribute_group nhmex_uncore_bbox_format_group = {
 	.name = "format",
 	.attrs = nhmex_uncore_bbox_formats_attr,
 };
@@ -484,7 +484,7 @@ static void nhmex_sbox_msr_enable_event(struct intel_uncore_box *box, struct per
 	NULL,
 };
 
-static struct attribute_group nhmex_uncore_sbox_format_group = {
+static const struct attribute_group nhmex_uncore_sbox_format_group = {
 	.name			= "format",
 	.attrs			= nhmex_uncore_sbox_formats_attr,
 };
@@ -898,7 +898,7 @@ static void nhmex_mbox_msr_enable_event(struct intel_uncore_box *box, struct per
 	NULL,
 };
 
-static struct attribute_group nhmex_uncore_mbox_format_group = {
+static const struct attribute_group nhmex_uncore_mbox_format_group = {
 	.name		= "format",
 	.attrs		= nhmex_uncore_mbox_formats_attr,
 };
@@ -1163,7 +1163,7 @@ static void nhmex_rbox_msr_enable_event(struct intel_uncore_box *box, struct per
 	NULL,
 };
 
-static struct attribute_group nhmex_uncore_rbox_format_group = {
+static const struct attribute_group nhmex_uncore_rbox_format_group = {
 	.name = "format",
 	.attrs = nhmex_uncore_rbox_formats_attr,
 };
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web