Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH v5 2/3] lib/igt_kms: Correct the check for igt_require
Date: Thu, 18 Jan 2024 11:45:21 +0530	[thread overview]
Message-ID: <761f6968-1f07-4d5b-a2dd-9482b44915df@intel.com> (raw)
In-Reply-To: <20240117145308.26010-1-mohammed.thasleem@intel.com>


On 1/17/2024 8:23 PM, Mohammed Thasleem wrote:
> 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);

Open() does return -1 in case of failure, with errorno set, so looks 
good to me.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


>   
>   	/*
>   	 * Display specific clock frequency info is moved to i915_cdclk_info,

WARNING: multiple messages have this Message-ID (diff)
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH v5 2/3] lib/igt_kms: Correct the check for igt_require
Date: Thu, 18 Jan 2024 11:45:21 +0530	[thread overview]
Message-ID: <761f6968-1f07-4d5b-a2dd-9482b44915df@intel.com> (raw)
Message-ID: <20240118061521.31UKoKt5SOrMraHWDissd_v1BKftS0Z0NNFoOEGimto@z> (raw)
In-Reply-To: <20240117145308.26010-1-mohammed.thasleem@intel.com>


On 1/17/2024 8:23 PM, Mohammed Thasleem wrote:
> 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);

Open() does return -1 in case of failure, with errorno set, so looks 
good to me.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


>   
>   	/*
>   	 * Display specific clock frequency info is moved to i915_cdclk_info,

  reply	other threads:[~2024-01-18  6:15 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   ` [PATCH v5 " Mohammed Thasleem
2024-01-18  6:15     ` Nautiyal, Ankit K [this message]
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=761f6968-1f07-4d5b-a2dd-9482b44915df@intel.com \
    --to=ankit.k.nautiyal@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