diff options
Diffstat (limited to 'tools/perf/util/tsc.c')
-rw-r--r-- | tools/perf/util/tsc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/tsc.c b/tools/perf/util/tsc.c index 4d4210d4e13d..1b741646eed0 100644 --- a/tools/perf/util/tsc.c +++ b/tools/perf/util/tsc.c | |||
@@ -19,7 +19,7 @@ u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc) | |||
19 | u64 quot, rem; | 19 | u64 quot, rem; |
20 | 20 | ||
21 | quot = cyc >> tc->time_shift; | 21 | quot = cyc >> tc->time_shift; |
22 | rem = cyc & ((1 << tc->time_shift) - 1); | 22 | rem = cyc & (((u64)1 << tc->time_shift) - 1); |
23 | return tc->time_zero + quot * tc->time_mult + | 23 | return tc->time_zero + quot * tc->time_mult + |
24 | ((rem * tc->time_mult) >> tc->time_shift); | 24 | ((rem * tc->time_mult) >> tc->time_shift); |
25 | } | 25 | } |