Skip to contentSkip to conversation

tests/kms_frontbuffer_tracking: Correctly handle debugfs errors

PATCH New Michal Wajdeczko 1 participant 1 message Dec 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/kms_frontbuffer_tracking: Correctly handle debugfs errors

In commit 3f6ae7b19 ("igt/kms_frontbuffer_tracking: Keep the debugfs dir around") we introduced custom variant of __igt_debugfs_read function that fires assert when debugfs returns an error. Replace that assert with proper error handling to allow use of errors like -ENODEV.

v2: allow only -ENODEV (Chris)

---
 tests/kms_frontbuffer_tracking.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/kms_frontbuffer_tracking.c +4 -1
index a068c8a..c6586c4 100644
@@ -783,7 +783,10 @@ static bool set_mode_for_params(struct modeset_params *params)
 static void __debugfs_read(const char *param, char *buf, int len)
 {
 	len = igt_sysfs_read(drm.debugfs, param, buf, len - 1);
-	igt_assert(len > 0);
+	if (len < 0) {
+		igt_assert_eq(len, -ENODEV);
+		len = 0;
+	}
 	buf[len] = '\0';
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx