public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mischa Jonker <Mischa.Jonker@synopsys.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	James Hogan <james.hogan@imgtec.com>,
	linux-kernel@vger.kernel.org, Vineet.Gupta1@synopsys.com
Cc: Mischa Jonker <Mischa.Jonker@synopsys.com>
Subject: [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg
Date: Tue,  4 Jun 2013 11:45:48 +0200	[thread overview]
Message-ID: <1370339148-5566-1-git-send-email-mjonker@synopsys.com> (raw)

This allows us to use pdev->name for registering a PMU device.
IMO the name is not supposed to be changed anyway.

Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
---
 arch/metag/kernel/perf/perf_event.c |    2 +-
 include/linux/perf_event.h          |    4 ++--
 kernel/events/core.c                |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c
index 3665694..5b18888 100644
--- a/arch/metag/kernel/perf/perf_event.c
+++ b/arch/metag/kernel/perf/perf_event.c
@@ -882,7 +882,7 @@ static int __init init_hw_perf_events(void)
 	}
 
 	register_cpu_notifier(&metag_pmu_notifier);
-	ret = perf_pmu_register(&pmu, (char *)metag_pmu->name, PERF_TYPE_RAW);
+	ret = perf_pmu_register(&pmu, metag_pmu->name, PERF_TYPE_RAW);
 out:
 	return ret;
 }
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index f463a46..65a462c 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -188,7 +188,7 @@ struct pmu {
 
 	struct device			*dev;
 	const struct attribute_group	**attr_groups;
-	char				*name;
+	const char			*name;
 	int				type;
 
 	int * __percpu			pmu_disable_count;
@@ -518,7 +518,7 @@ struct perf_output_handle {
 
 #ifdef CONFIG_PERF_EVENTS
 
-extern int perf_pmu_register(struct pmu *pmu, char *name, int type);
+extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
 extern void perf_pmu_unregister(struct pmu *pmu);
 
 extern int perf_num_counters(void);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9dc297f..7003d6f 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5952,7 +5952,7 @@ free_dev:
 static struct lock_class_key cpuctx_mutex;
 static struct lock_class_key cpuctx_lock;
 
-int perf_pmu_register(struct pmu *pmu, char *name, int type)
+int perf_pmu_register(struct pmu *pmu, const char *name, int type)
 {
 	int cpu, ret;
 
-- 
1.7.0.4


             reply	other threads:[~2013-06-04  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04  9:45 Mischa Jonker [this message]
2013-06-04  9:58 ` [PATCH] perf: add const qualifier to perf_pmu_register's 'name' arg Peter Zijlstra
2013-06-04 10:02   ` Vineet Gupta
2013-06-04 11:03     ` Peter Zijlstra
2013-06-04 11:09       ` Vineet Gupta
2013-06-04 11:18         ` Peter Zijlstra
2013-06-12 11:49           ` James Hogan
2013-06-19 18:38 ` [tip:perf/core] perf: Add " tip-bot for Mischa Jonker

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=1370339148-5566-1-git-send-email-mjonker@synopsys.com \
    --to=mischa.jonker@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.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