[PATCH] drm/i915/selftests: silence a bogus spammy warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These tests are reversed so it complains on every successful call and
stays quiet for every failure.  Also we may as well preserve the error
code.

Fixes: f40a7b7558ef ("drm/i915: Initial selftests for exercising eviction")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
Static analysis.  Not tested.

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
index 14e9c2fbc4e6..0448ef9ee807 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
@@ -152,9 +152,9 @@ static int igt_overcommit(void *arg)
 	list_move(&obj->global_link, &i915->mm.unbound_list);
 
 	vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, 0);
-	if (!IS_ERR(vma) || PTR_ERR(vma) != -ENOSPC) {
+	if (IS_ERR(vma) && PTR_ERR(vma) != -ENOSPC) {
 		pr_err("Failed to evict+insert, i915_gem_object_ggtt_pin returned err=%d\n", (int)PTR_ERR(vma));
-		err = -EINVAL;
+		err = PTR_ERR(vma);
 		goto cleanup;
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux