From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 1/6] lib/dsc: Fix return value
Date: Thu, 2 Feb 2023 12:51:16 +0530 [thread overview]
Message-ID: <20230202072121.26153-2-swati2.sharma@intel.com> (raw)
In-Reply-To: <20230202072121.26153-1-swati2.sharma@intel.com>
0 is usually success, < 0 is error. Fix that.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
lib/igt_dsc.c | 7 +++++--
tests/i915/kms_dsc_helper.c | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 25dcb5840..64dd6b29a 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -35,6 +35,9 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
close(debugfs_fd);
+ if (ret > 0)
+ return 0;
+
return ret;
}
@@ -92,7 +95,7 @@ bool igt_is_force_dsc_enabled(int drmfd, char *connector_name)
* @drmfd: A drm file descriptor
* @connector_name: Name of the libdrm connector we're going to use
*
- * Returns: 1 on success or negative error code, in case of failure.
+ * Returns: 0 on success or negative error code, in case of failure.
*/
int igt_force_dsc_enable(int drmfd, char *connector_name)
{
@@ -105,7 +108,7 @@ int igt_force_dsc_enable(int drmfd, char *connector_name)
* @connector_name: Name of the libdrm connector we're going to use
* @bpc: Input BPC
*
- * Returns: No. of bytes written or negative error code, in case of failure.
+ * Returns: 0 on success or negative error code, in case of failure.
*/
int igt_force_dsc_enable_bpc(int drmfd, char *connector_name, int bpc)
{
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index a80f3d787..e2c278c7a 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -14,7 +14,7 @@ void force_dsc_enable(int drmfd, igt_output_t *output)
igt_debug("Forcing DSC enable on %s\n", output->name);
ret = igt_force_dsc_enable(drmfd, output->name);
- igt_assert_f(ret > 0, "forcing dsc enable debugfs_write failed\n");
+ igt_assert_f(ret == 0, "forcing dsc enable debugfs_write failed\n");
}
void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc)
@@ -24,7 +24,7 @@ void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc)
igt_debug("Forcing input DSC BPC to %d on %s\n",
input_bpc, output->name);
ret = igt_force_dsc_enable_bpc(drmfd, output->name, input_bpc);
- igt_assert_f(ret > 0, "forcing input dsc bpc debugfs_write failed\n");
+ igt_assert_f(ret == 0, "forcing input dsc bpc debugfs_write failed\n");
}
void save_force_dsc_en(int drmfd, igt_output_t *output)
--
2.25.1
next prev parent reply other threads:[~2023-02-02 7:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 7:21 [igt-dev] [PATCH i-g-t v2 0/6] Enable VDSC output formats validation Swati Sharma
2023-02-02 7:21 ` Swati Sharma [this message]
2023-02-02 7:21 ` [igt-dev] [PATCH i-g-t v2 2/6] tests/i915/kms_dsc: Add plane_format as struct data_t member Swati Sharma
2023-02-02 7:21 ` [igt-dev] [PATCH i-g-t v2 3/6] tests/i915/kms_dsc: Remove pointless struct Swati Sharma
2023-02-03 12:29 ` Kamil Konieczny
2023-02-03 13:26 ` Swati Sharma
2023-02-02 7:21 ` [igt-dev] [PATCH i-g-t v2 4/6] tests/i915/kms_dsc: Make bpc_list static Swati Sharma
2023-02-02 7:21 ` [igt-dev] [PATCH i-g-t v2 5/6] lib/dsc: Add helpers for VDSC output format debugfs entry Swati Sharma
2023-02-03 12:39 ` Kamil Konieczny
2023-02-03 13:28 ` Swati Sharma
2023-02-02 7:21 ` [igt-dev] [PATCH i-g-t v2 6/6] tests/i915/kms_dsc: Enable validation for VDSC output formats Swati Sharma
2023-02-02 7:48 ` [igt-dev] ✓ Fi.CI.BAT: success for Enable VDSC output formats validation (rev2) Patchwork
2023-02-02 10:52 ` [igt-dev] [PATCH i-g-t v2 0/6] Enable VDSC output formats validation Hogander, Jouni
2023-02-03 10:53 ` Swati Sharma
2023-02-02 16:00 ` [igt-dev] ✓ Fi.CI.IGT: success for Enable VDSC output formats validation (rev2) 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=20230202072121.26153-2-swati2.sharma@intel.com \
--to=swati2.sharma@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