All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] lib: Remove overzealous assertion on gem_set_caching()
@ 2018-02-17 11:29 ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2018-02-17 11:29 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

When the asserts were added for the acceptable error codes for
SET_CACHING ioctl, foresight was not given to the possibility that the
device may not handle the caching mode and return -ENODEV. Remove the
error code assertion from the library, that is the job for the ABI
tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/ioctl_wrappers.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 7b656cce..8748cfcf 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -208,10 +208,10 @@ static int __gem_set_caching(int fd, uint32_t handle, uint32_t caching)
 	arg.caching = caching;
 
 	err = 0;
-	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_SET_CACHING, &arg)) {
+	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_SET_CACHING, &arg))
 		err = -errno;
-		igt_assert(errno == ENOTTY || errno == EINVAL);
-	}
+
+	errno = 0;
 	return err;
 }
 
@@ -229,7 +229,6 @@ static int __gem_set_caching(int fd, uint32_t handle, uint32_t caching)
 void gem_set_caching(int fd, uint32_t handle, uint32_t caching)
 {
 	igt_require(__gem_set_caching(fd, handle, caching) == 0);
-	errno = 0;
 }
 
 /**
-- 
2.16.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-17 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-17 11:29 [PATCH igt] lib: Remove overzealous assertion on gem_set_caching() Chris Wilson
2018-02-17 11:29 ` [igt-dev] " Chris Wilson
2018-02-17 12:03 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-02-17 12:56 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.