diff options
Diffstat (limited to 'drivers/oprofile')
-rw-r--r-- | drivers/oprofile/oprofile_perf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c index 6853634c4681..a34137f2e26c 100644 --- a/drivers/oprofile/oprofile_perf.c +++ b/drivers/oprofile/oprofile_perf.c | |||
@@ -71,28 +71,28 @@ static void op_perf_setup(void) | |||
71 | 71 | ||
72 | static int op_create_counter(int cpu, int event) | 72 | static int op_create_counter(int cpu, int event) |
73 | { | 73 | { |
74 | int ret = 0; | ||
75 | struct perf_event *pevent; | 74 | struct perf_event *pevent; |
76 | 75 | ||
77 | if (!counter_config[event].enabled || (perf_events[cpu][event] != NULL)) | 76 | if (!counter_config[event].enabled || perf_events[cpu][event]) |
78 | return ret; | 77 | return 0; |
79 | 78 | ||
80 | pevent = perf_event_create_kernel_counter(&counter_config[event].attr, | 79 | pevent = perf_event_create_kernel_counter(&counter_config[event].attr, |
81 | cpu, -1, | 80 | cpu, -1, |
82 | op_overflow_handler); | 81 | op_overflow_handler); |
83 | 82 | ||
84 | if (IS_ERR(pevent)) { | 83 | if (IS_ERR(pevent)) |
85 | ret = PTR_ERR(pevent); | 84 | return PTR_ERR(pevent); |
86 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | 85 | |
86 | if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | ||
87 | perf_event_release_kernel(pevent); | 87 | perf_event_release_kernel(pevent); |
88 | pr_warning("oprofile: failed to enable event %d " | 88 | pr_warning("oprofile: failed to enable event %d " |
89 | "on CPU %d\n", event, cpu); | 89 | "on CPU %d\n", event, cpu); |
90 | ret = -EBUSY; | 90 | return -EBUSY; |
91 | } else { | ||
92 | perf_events[cpu][event] = pevent; | ||
93 | } | 91 | } |
94 | 92 | ||
95 | return ret; | 93 | perf_events[cpu][event] = pevent; |
94 | |||
95 | return 0; | ||
96 | } | 96 | } |
97 | 97 | ||
98 | static void op_destroy_counter(int cpu, int event) | 98 | static void op_destroy_counter(int cpu, int event) |