mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
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 2/7] perf: x86: intel: uncore_nhmex: constify attribute_group structures.
Date: Thu, 20 Jul 2017 12:51:40 +0530	[thread overview]
Message-ID: <1500535305-9369-3-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1500535305-9369-1-git-send-email-arvind.yadav.cs@gmail.com>

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

  parent reply	other threads:[~2017-07-20  7:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20  7:21 [PATCH 0/7] constify x86 " Arvind Yadav
2017-07-20  7:21 ` [PATCH 1/7] perf: x86: intel: uncore: constify " Arvind Yadav
2017-07-20  7:21 ` Arvind Yadav [this message]
2017-07-20  7:21 ` [PATCH 3/7] perf: x86: intel: uncore_snb: " Arvind Yadav
2017-07-20  7:21 ` [PATCH 4/7] perf: x86: intel: uncore_snbep: " Arvind Yadav
2017-07-20  7:21 ` [PATCH 5/7] x86: ksysfs: " Arvind Yadav
2017-07-20  7:21 ` [PATCH 6/7] x86: therm_throt: " Arvind Yadav
2017-07-20  7:21 ` [PATCH 7/7] x86: microcode: " Arvind Yadav
2017-07-20  8:12   ` Borislav Petkov
2017-07-20  8:18     ` Arvind Yadav
2017-07-20  8:28       ` Borislav Petkov
2017-07-20  9:01         ` Arvind Yadav
2017-07-20 10:31           ` Borislav Petkov
2017-07-20 11:01             ` Arvind Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500535305-9369-3-git-send-email-arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®