Skip to content

Commit

Permalink
KVM: x86: remove redundant ret variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhang songyi authored and sean-jc committed Jan 19, 2023
1 parent de60733 commit 14bd051
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions arch/x86/kvm/lapic.c
Expand Up @@ -1487,7 +1487,6 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
{
ktime_t remaining, now;
s64 ns;
u32 tmcct;

ASSERT(apic != NULL);

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

ns = mod_64(ktime_to_ns(remaining), apic->lapic_timer.period);
tmcct = div64_u64(ns,
(APIC_BUS_CYCLE_NS * apic->divide_count));

return tmcct;
return div64_u64(ns, (APIC_BUS_CYCLE_NS * apic->divide_count));
}

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

0 comments on commit 14bd051

Please sign in to comment.