diff options
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_amd_ibs.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c index 29a1bffe1dfb..3e32908292a7 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c | |||
@@ -78,16 +78,13 @@ perf_event_set_period(struct hw_perf_event *hwc, u64 min, u64 max, u64 *hw_perio | |||
78 | overflow = 1; | 78 | overflow = 1; |
79 | } | 79 | } |
80 | 80 | ||
81 | if (unlikely(left <= 0)) { | 81 | if (unlikely(left < (s64)min)) { |
82 | left += period; | 82 | left += period; |
83 | local64_set(&hwc->period_left, left); | 83 | local64_set(&hwc->period_left, left); |
84 | hwc->last_period = period; | 84 | hwc->last_period = period; |
85 | overflow = 1; | 85 | overflow = 1; |
86 | } | 86 | } |
87 | 87 | ||
88 | if (unlikely(left < min)) | ||
89 | left = min; | ||
90 | |||
91 | if (left > max) | 88 | if (left > max) |
92 | left = max; | 89 | left = max; |
93 | 90 | ||