Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mohammed Thasleem <mohammed.thasleem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH v5 2/3] lib/igt_kms: Correct the check for igt_require
Date: Wed, 17 Jan 2024 20:23:08 +0530	[thread overview]
Message-ID: <20240117145308.26010-1-mohammed.thasleem@intel.com> (raw)
In-Reply-To: <20240117141323.14994-3-mohammed.thasleem@intel.com>

The function 'igt_debugfs_dir()' returns -1, if it fails and a non-negative
fd otherwise. However in the function igt_get_max_dotclock() the condition
to check the debugfs directory uses igt_require (dir), which fails even if
the dir is 0.
So correct the igt_require check for a valid igt_debugfs fd.

v2: Correct the logic in igt_require.

Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e4dea1a60..1b4d0d761 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6100,7 +6100,7 @@ int igt_get_max_dotclock(int fd)
 	drmModeFreeResources(resources);
 
 	dir = igt_debugfs_dir(fd);
-	igt_require(dir);
+	igt_require(dir != -1);
 
 	/*
 	 * Display specific clock frequency info is moved to i915_cdclk_info,
-- 
2.25.1



  reply	other threads:[~2024-01-17 14:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 14:13 [PATCH v4 0/3] Cache xe_device info for lease fd Mohammed Thasleem
2024-01-17 14:13 ` [PATCH v4 1/3] tests/kms_lease: " Mohammed Thasleem
2024-01-17 14:13 ` [PATCH v4 2/3] lib/igt_kms: Correct the check for igt_require Mohammed Thasleem
2024-01-17 14:53   ` Mohammed Thasleem [this message]
2024-01-18  6:15     ` [PATCH v5 " Nautiyal, Ankit K
2024-01-18  6:15       ` Nautiyal, Ankit K
2024-01-17 14:13 ` [PATCH v4 3/3] HAX/DO_NOT_MERGE: Patch adding to test to kms_lease Mohammed Thasleem
2024-01-17 15:25 ` ✓ Fi.CI.BAT: success for Cache xe_device info for lease fd (rev4) Patchwork
2024-01-17 15:48 ` ✗ CI.xeBAT: failure " Patchwork
2024-01-17 16:01 ` ✓ Fi.CI.BAT: success for Cache xe_device info for lease fd (rev5) Patchwork
2024-01-17 16:02 ` ✓ CI.xeBAT: " Patchwork
2024-01-17 18:38 ` ✗ Fi.CI.IGT: failure for Cache xe_device info for lease fd (rev4) Patchwork
2024-01-17 19:41 ` ✗ Fi.CI.IGT: failure for Cache xe_device info for lease fd (rev5) Patchwork
2024-01-18  7:14 ` ✓ Fi.CI.IGT: success " 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=20240117145308.26010-1-mohammed.thasleem@intel.com \
    --to=mohammed.thasleem@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