Skip to contentSkip to conversation

KVM: x86: Replace IS_ERR() with IS_ERR_VALUE()

PATCH Applied [email protected] 2 participants 2 messages Nov 16, 2022 – Jan 28, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: x86: Replace IS_ERR() with IS_ERR_VALUE()

From: ye xingchen <[email protected]>

Avoid type casts that are needed for IS_ERR() and use IS_ERR_VALUE() instead.

---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/x86.c +1 -1
index aa39e6c2d1f1..c2eaa9b8d2cb 100644
@@ -12483,7 +12483,7 @@ void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa,
 		 */
 		hva = vm_mmap(NULL, 0, size, PROT_READ | PROT_WRITE,
 			      MAP_SHARED | MAP_ANONYMOUS, 0);
-		if (IS_ERR((void *)hva))
+		if (IS_ERR_VALUE(hva))
 			return (void __user *)hva;
 	} else {
 		if (!slot || !slot->npages)
Signature · 1 line
2.25.1