From 54dc25efaf10d87962f95be9b1d1a8f0f907912b Mon Sep 17 00:00:00 2001 From: Lukasz Laguna Date: Wed, 12 Jul 2023 14:33:13 +0200 Subject: lib/igt_sysfs: add asserting helpers for read/write operations Prefix names of existing, non-asserting helpers with "__": - igt_sysfs_get_u32 -> __igt_sysfs_get_u32 - igt_sysfs_set_u32 -> __igt_sysfs_set_u32 - igt_sysfs_get_u64 -> __igt_sysfs_get_u64 - igt_sysfs_set_u64 -> __igt_sysfs_set_u64 - igt_sysfs_get_boolean -> __igt_sysfs_get_boolean - igt_sysfs_set_boolean -> __igt_sysfs_set_boolean Replace calls to don't introduce any functional changes in the existing code. Additionally, reimplement non-asserting get helpers to return boolean result of the read operation and store the read value via pointer passed as function parameter. In previous implementation, it wasn't possible to distinguish if returned zero was a read value or failure on a read attempt. On the occasion, fixed a typo in modified debug message. Signed-off-by: Lukasz Laguna Reviewed-by: Kamil Konieczny --- tests/kms_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/kms_prime.c') diff --git a/tests/kms_prime.c b/tests/kms_prime.c index 52f587961..dedbf6233 100644 --- a/tests/kms_prime.c +++ b/tests/kms_prime.c @@ -341,7 +341,7 @@ static void kms_poll_state_restore(void) int sysfs_fd; igt_assert((sysfs_fd = open(KMS_HELPER, O_RDONLY)) >= 0); - igt_sysfs_set_boolean(sysfs_fd, "poll", kms_poll_saved_state); + __igt_sysfs_set_boolean(sysfs_fd, "poll", kms_poll_saved_state); close(sysfs_fd); } -- cgit v1.2.3