diff options
author | Peter Zijlstra <peterz@infradead.org> | 2015-05-21 04:57:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-27 03:17:44 -0400 |
commit | 1fe684e349e904adeed2883cfdeef259a21c94f4 (patch) | |
tree | 24b41966e9a9854c7b5e6d3ed525fc71f2309581 | |
parent | 0c41e756b9c5a9899b5cd238226600f8f34c9b82 (diff) |
perf/x86/intel: Remove pointless tests
Both intel_commit_scheduling() and intel_get_excl_contraints() test
for cntr < 0.
The only way that can happen (aside from a bug) is through
validate_event(), however that is already captured by the
cpuc->is_fake test.
So remove these test and simplify the code.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index ff56fc3f016e..6a3e794cdc06 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -1954,12 +1954,10 @@ static void intel_commit_scheduling(struct cpu_hw_events *cpuc, int idx, int cnt | |||
1954 | 1954 | ||
1955 | lockdep_assert_held(&excl_cntrs->lock); | 1955 | lockdep_assert_held(&excl_cntrs->lock); |
1956 | 1956 | ||
1957 | if (cntr >= 0) { | 1957 | if (c->flags & PERF_X86_EVENT_EXCL) |
1958 | if (c->flags & PERF_X86_EVENT_EXCL) | 1958 | xl->init_state[cntr] = INTEL_EXCL_EXCLUSIVE; |
1959 | xl->init_state[cntr] = INTEL_EXCL_EXCLUSIVE; | 1959 | else |
1960 | else | 1960 | xl->init_state[cntr] = INTEL_EXCL_SHARED; |
1961 | xl->init_state[cntr] = INTEL_EXCL_SHARED; | ||
1962 | } | ||
1963 | } | 1961 | } |
1964 | 1962 | ||
1965 | static void | 1963 | static void |
@@ -2027,10 +2025,6 @@ intel_get_excl_constraints(struct cpu_hw_events *cpuc, struct perf_event *event, | |||
2027 | if (!(c->flags & PERF_X86_EVENT_DYNAMIC)) { | 2025 | if (!(c->flags & PERF_X86_EVENT_DYNAMIC)) { |
2028 | struct event_constraint *cx; | 2026 | struct event_constraint *cx; |
2029 | 2027 | ||
2030 | /* sanity check */ | ||
2031 | if (idx < 0) | ||
2032 | return &emptyconstraint; | ||
2033 | |||
2034 | /* | 2028 | /* |
2035 | * grab pre-allocated constraint entry | 2029 | * grab pre-allocated constraint entry |
2036 | */ | 2030 | */ |