perf: Add const qualifier to perf_pmu_register's 'name' arg
authorMischa Jonker <Mischa.Jonker@synopsys.com>
Tue, 4 Jun 2013 09:45:48 +0000 (11:45 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Jun 2013 10:50:23 +0000 (12:50 +0200)
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>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1370339148-5566-1-git-send-email-mjonker@synopsys.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/metag/kernel/perf/perf_event.c
include/linux/perf_event.h
kernel/events/core.c

index 366569425c52a5febc1a7256cf68137365b85227..5b18888ee3648d5575e911499c3fd14c07260e99 100644 (file)
@@ -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;
 }
index 74a4e14ab60b1cfce640c212df3cf43b79904343..4bc57d017fc8e090603440772696ac7e7ba1931c 100644 (file)
@@ -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;
@@ -519,7 +519,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);
index aca95bce34c89f6dde0f922bd8b53d5848133de3..9c8920783317b641609da2670570b2052c7a3fb5 100644 (file)
@@ -6179,7 +6179,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;