Skip to contentSkip to conversation

KVM: x86: get rid of odd out jump label in pdptrs_changed

PATCH linmiaohe 1 participant 1 message Oct 25, 2019 KVM

lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 13 lines · Paolo Bonzini

Review

Quoted 9 lines · Miaohe Lin
(quoted diff) +3 -4
-	if (r < 0)
-		goto out;
-	changed = memcmp(pdpte, vcpu->arch.walk_mmu->pdptrs, sizeof(pdpte)) != 0;
-out:
+	if (r >= 0)
+		changed = memcmp(pdpte, vcpu->arch.walk_mmu->pdptrs,
+				 sizeof(pdpte)) != 0;
 
 	return changed;

Even better:

Quoted 6 lines
	if (r < 0)
		return true;

	return memcmp(...) != 0;

Paolo

Thanks for your suggestion. I will send a patch v2 to complete it. Many thanks.