Return-Path: Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2042.outbound.protection.outlook.com [40.107.220.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDB7189C9A for ; Mon, 14 Jun 2021 15:36:26 +0000 (UTC) From: Anson Jacob Date: Mon, 14 Jun 2021 11:35:57 -0400 Message-ID: <20210614153557.19934-2-Anson.Jacob@amd.com> In-Reply-To: <20210614153557.19934-1-Anson.Jacob@amd.com> References: <20210614153557.19934-1-Anson.Jacob@amd.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t 2/2] tests/amdgpu: Fix typo in amd_module_load List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org, Harry.Wentland@amd.com, Rodrigo.Siqueira@amd.com, markyacoub@google.com Cc: Anson Jacob , Victor Lu List-ID: From: Victor Lu A typo in amd_module_load was causing the test to fail. igt_assert_f(err, 0) should have been igt_assert_eq(err, 0), to check err == 0. Also added drm_fd >= 0 check and made ioctl query more explicit. Signed-off-by: Victor Lu Acked-by: Anson Jacob --- tests/amdgpu/amd_module_load.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/amdgpu/amd_module_load.c b/tests/amdgpu/amd_module_load.c index e682d2c5..8762b2a2 100644 --- a/tests/amdgpu/amd_module_load.c +++ b/tests/amdgpu/amd_module_load.c @@ -41,8 +41,10 @@ sanity_check(void) args.return_pointer = (uintptr_t) &arg_ret; args.return_size = sizeof(int); args.query = AMDGPU_INFO_HW_IP_INFO; + args.query_hw_ip.type = AMDGPU_HW_IP_COMPUTE; fd = drm_open_driver(DRIVER_AMDGPU); + igt_assert_f(fd >= 0, "Module failed to load\n"); igt_set_timeout(1, "Module reload timeout!"); if (ioctl(fd, DRM_IOCTL_AMDGPU_INFO, &args) < 0) @@ -51,7 +53,7 @@ sanity_check(void) igt_set_timeout(0, NULL); close(fd); - igt_assert_f(err, 0); + igt_assert_eq(err, 0); } igt_main -- 2.25.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev