Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_core: Don't return too early in common_init_config
@ 2020-10-26  8:48 Petri Latvala
  2020-10-26  9:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Petri Latvala @ 2020-10-26  8:48 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

common_init_config is responsible for adding the device filters
supplied through the environment to the filter list. If the .igtrc
file cannot be opened, make sure the filter is added still.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arek@hiler.eu>
---
 lib/igt_core.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index b358173f..8f9d925b 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -775,21 +775,20 @@ GKeyFile *igt_load_igtrc(void)
 static void common_init_config(void)
 {
 	GError *error = NULL;
-	int ret;
+	int ret = 0;
 
 	igt_key_file = igt_load_igtrc();
-	if (!igt_key_file)
-		return;
 
-	if (!igt_frame_dump_path)
+	if (igt_key_file && !igt_frame_dump_path)
 		igt_frame_dump_path =
 			g_key_file_get_string(igt_key_file, "Common",
 					      "FrameDumpPath", &error);
 
 	g_clear_error(&error);
 
-	ret = g_key_file_get_integer(igt_key_file, "DUT", "SuspendResumeDelay",
-				     &error);
+	if (igt_key_file)
+		ret = g_key_file_get_integer(igt_key_file, "DUT", "SuspendResumeDelay",
+					     &error);
 	assert(!error || error->code != G_KEY_FILE_ERROR_INVALID_VALUE);
 
 	g_clear_error(&error);
@@ -804,9 +803,10 @@ static void common_init_config(void)
 		if (igt_rc_device) {
 			igt_debug("Notice: using IGT_DEVICE env:\n");
 		} else {
-			igt_rc_device =	g_key_file_get_string(igt_key_file,
-							      "Common",
-							      "Device", &error);
+			if (igt_key_file)
+				igt_rc_device =	g_key_file_get_string(igt_key_file,
+								      "Common",
+								      "Device", &error);
 			g_clear_error(&error);
 			if (igt_rc_device)
 				igt_debug("Notice: using .igtrc "
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-04 10:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-26  8:48 [igt-dev] [PATCH i-g-t] lib/igt_core: Don't return too early in common_init_config Petri Latvala
2020-10-26  9:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-10-26 11:22 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-11-03  5:13 ` [igt-dev] [PATCH i-g-t] " Dixit, Ashutosh
2020-11-03  8:05   ` Petri Latvala
2020-11-03 23:11     ` Dixit, Ashutosh
2020-11-04 10:34       ` Petri Latvala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox