<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 3/12/2024 11:43 AM, Janusz
      Krzysztofik wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:85522185.BzKH3j3Lxt@jkrzyszt-mobl2.ger.corp.intel.com">
      <pre class="moz-quote-pre" wrap="">Hi Nirmoy,

On Tuesday, 12 March 2024 11:07:57 CET Nirmoy Das wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Skip the test if no drm devices are preset.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Did you mean present? (also in the subject line)</pre>
    </blockquote>
    Right, another typo<br>
    <blockquote type="cite" cite="mid:85522185.BzKH3j3Lxt@jkrzyszt-mobl2.ger.corp.intel.com">
      <pre class="moz-quote-pre" wrap="">

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
v2: fix a typo.

Closes: <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/drm/intel/-/issues/10087">https://gitlab.freedesktop.org/drm/intel/-/issues/10087</a>
Signed-off-by: Nirmoy Das <a class="moz-txt-link-rfc2396E" href="mailto:nirmoy.das@intel.com"><nirmoy.das@intel.com></a>
---
 tests/device_reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/device_reset.c b/tests/device_reset.c
index 817cbc285..73531d696 100644
--- a/tests/device_reset.c
+++ b/tests/device_reset.c
@@ -198,7 +198,7 @@ static void init_device_fds(struct device_fds *dev)
         * a device file descriptor open for exit handler use.
         */
        dev->fds.dev = __drm_open_driver(DRIVER_ANY);
-       igt_assert_fd(dev->fds.dev);
+       igt_require(dev->fds.dev != -1);
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
What if __drm_open_driver() returns (unlikely) a negative value other than -1? </pre>
    </blockquote>
    <pre class="moz-quote-pre" wrap="">__drm_open_driver <span style="white-space: normal">doc says: "An open DRM fd or -1 on error" so that won't happen. </span>
</pre>
    <blockquote type="cite" cite="mid:85522185.BzKH3j3Lxt@jkrzyszt-mobl2.ger.corp.intel.com">
      <pre class="moz-quote-pre" wrap=""> 
In IGT we used to verify validity of a file descriptor by checking if its 
value is not negative, i.e., >= 0 (see e.g. lib/igt_core:igt_assert_fd(), 
lib/drmtest.c:drm_open_driver()).  Please follow the same convention.
</pre>
    </blockquote>
    <p>I can do s/<span style="white-space: pre-wrap">igt_assert_fd/igt_require_fd </span></p>
    <p><span style="white-space: pre-wrap">
</span></p>
    <p><span style="white-space: pre-wrap">Thanks,</span></p>
    <p><span style="white-space: pre-wrap">Nirmoy
</span></p>
    <blockquote type="cite" cite="mid:85522185.BzKH3j3Lxt@jkrzyszt-mobl2.ger.corp.intel.com">
      <pre class="moz-quote-pre" wrap="">
Thanks,
Janusz

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">   if (is_i915_device(dev->fds.dev))
                igt_require_gem(dev->fds.dev);
 

</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">



</pre>
    </blockquote>
  </body>
</html>