Skip to content

Commit 14bd051

Browse files
zhang songyisean-jc
authored andcommitted
KVM: x86: remove redundant ret variable
Return value from apic_get_tmcct() directly instead of taking this in another redundant variable. Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn> Link: https://lore.kernel.org/r/202211231704457807160@zte.com.cn Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent de60733 commit 14bd051

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,6 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
14871487
{
14881488
ktime_t remaining, now;
14891489
s64 ns;
1490-
u32 tmcct;
14911490

14921491
ASSERT(apic != NULL);
14931492

@@ -1502,10 +1501,7 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
15021501
remaining = 0;
15031502

15041503
ns = mod_64(ktime_to_ns(remaining), apic->lapic_timer.period);
1505-
tmcct = div64_u64(ns,
1506-
(APIC_BUS_CYCLE_NS * apic->divide_count));
1507-
1508-
return tmcct;
1504+
return div64_u64(ns, (APIC_BUS_CYCLE_NS * apic->divide_count));
15091505
}
15101506

15111507
static void __report_tpr_access(struct kvm_lapic *apic, bool write)

0 commit comments

Comments
 (0)