Skip to content

Commit df0114f

Browse files
ColinIanKinghansendc
authored andcommitted
x86/resctrl: Remove redundant assignment to variable chunks
The variable chunks is being shifted right and re-assinged the shifted value which is then returned. Since chunks is not being read afterwards the assignment is redundant and the >>= operator can be replaced with a shift >> operator instead. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Fenghua Yu <fenghua.yu@intel.com> Link: https://lkml.kernel.org/r/20211207223735.35173-1-colin.i.king@gmail.com
1 parent 0fcfb00 commit df0114f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static u64 mbm_overflow_count(u64 prev_msr, u64 cur_msr, unsigned int width)
282282
u64 shift = 64 - width, chunks;
283283

284284
chunks = (cur_msr << shift) - (prev_msr << shift);
285-
return chunks >>= shift;
285+
return chunks >> shift;
286286
}
287287

288288
static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)

0 commit comments

Comments
 (0)