From: Mark Yacoub <markyacoub@chromium.org>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH v2] lib/igt_chamelium: Check for error instead of port id for invalid
Date: Fri, 29 Jul 2022 10:51:54 -0400 [thread overview]
Message-ID: <20220729145154.1101502-1-markyacoub@chromium.org> (raw)
In-Reply-To: <20220715192200.1782193-1-markyacoub@chromium.org>
[Why]
Chamelium V3 has a valid port 0 so 0 should not be rejected.
[How]
Check if there is an error set from g_key_file_get_integer instead of
depending on port id.
v1:
Use GError instead of check for port ID range.
Test: ./kms_chamelium --run-subtest dp-hp
Tested on: Volteer & cv3
Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
---
lib/igt_chamelium.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index c7b99ebc..fbdb87ac 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -2311,7 +2311,7 @@ static bool chamelium_read_port_mappings(struct chamelium *chamelium,
port->id = g_key_file_get_integer(igt_key_file, group,
"ChameliumPortID",
&error);
- if (!port->id) {
+ if (error) {
igt_warn("Failed to read chamelium port ID for %s: %s\n",
map_name, error->message);
ret = false;
--
2.37.1.455.g008518b4e5-goog
next prev parent reply other threads:[~2022-07-29 14:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 19:22 [igt-dev] [PATCH] lib/igt_chamelium: Extend check of valid ports to port=0 Mark Yacoub
2022-07-15 19:29 ` Alexandru M Stan
2022-07-29 13:15 ` Petri Latvala
2022-07-16 15:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-07-16 17:15 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-07-18 14:42 ` Mark Yacoub
2022-07-18 21:39 ` Vudum, Lakshminarayana
2022-07-18 15:05 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2022-07-29 13:12 ` [igt-dev] [PATCH] " Petri Latvala
2022-07-29 14:53 ` Mark Yacoub
2022-07-29 14:51 ` Mark Yacoub [this message]
2022-08-01 10:07 ` [igt-dev] [PATCH v2] lib/igt_chamelium: Check for error instead of port id for invalid Petri Latvala
2022-08-01 12:21 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_chamelium: Extend check of valid ports to port=0 (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=20220729145154.1101502-1-markyacoub@chromium.org \
--to=markyacoub@chromium.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.