From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 2/2] tests/i915/gem_mmap: fix bad-object tests error value
Date: Fri, 31 May 2019 15:07:23 +0300 [thread overview]
Message-ID: <20190531120723.23889-2-simon.ser@intel.com> (raw)
In-Reply-To: <20190531120723.23889-1-simon.ser@intel.com>
These tests checked for EINVAL, but the correct error value is ENOENT, as
pointed out by Chris Wilson:
commit bf79cb914dbfe848add8bb76cbb8ff89110d29ff
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Aug 4 14:19:46 2010 +0100
drm: Use ENOENT consistently for the error return for an unmatched handle.
This is consistent with trying to access a filename that not exist
within a directory which is a good analogy here. The main reason for the
change is that it is easy to confuse the error code of EBADF as an
performing an ioctl on an invalid file descriptor (rather than an
unknown object).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit fixes the two bad tests (the gem_mmap_gtt test already checks for
ENOENT).
Signed-off-by: Simon Ser <simon.ser@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/i915/gem_mmap.c | 2 +-
tests/i915/gem_mmap_wc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/i915/gem_mmap.c b/tests/i915/gem_mmap.c
index c96aa2c0a7a5..f8cf052e3cc5 100644
--- a/tests/i915/gem_mmap.c
+++ b/tests/i915/gem_mmap.c
@@ -173,7 +173,7 @@ igt_main
};
igt_debug("Trying MMAP IOCTL with handle %x\n", handles[i]);
- igt_assert_eq(mmap_ioctl(fd, &arg), -EINVAL);
+ igt_assert_eq(mmap_ioctl(fd, &arg), -ENOENT);
}
gem_close(fd, real_handle);
diff --git a/tests/i915/gem_mmap_wc.c b/tests/i915/gem_mmap_wc.c
index 63538f791aae..c9e5bf23b868 100644
--- a/tests/i915/gem_mmap_wc.c
+++ b/tests/i915/gem_mmap_wc.c
@@ -510,7 +510,7 @@ igt_main
.size = 4096,
.flags = I915_MMAP_WC,
};
- igt_assert_eq(mmap_ioctl(fd, &arg), -EINVAL);
+ igt_assert_eq(mmap_ioctl(fd, &arg), -ENOENT);
}
gem_close(fd, real_handle);
--
2.21.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-05-31 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 12:07 [igt-dev] [PATCH i-g-t v2 1/2] tests/i915/gen_mmap: fix no-op loops Simon Ser
2019-05-31 12:07 ` Simon Ser [this message]
2019-06-06 6:12 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/i915/gem_mmap: fix bad-object tests error value Arkadiusz Hiler
2019-05-31 16:05 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/2] tests/i915/gen_mmap: fix no-op loops Patchwork
2019-06-01 19:50 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190531120723.23889-2-simon.ser@intel.com \
--to=simon.ser@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox