diff --git a/tests/rdma/simple/app/rdma_test.cpp b/tests/rdma/simple/app/rdma_test.cpp index 79aaf8ae33..211299fd10 100644 --- a/tests/rdma/simple/app/rdma_test.cpp +++ b/tests/rdma/simple/app/rdma_test.cpp @@ -130,7 +130,7 @@ void run_rdma_tests(HSAuint32 Node, HsaMemoryProperties *MemoryProperty) ret = ioctl(rdma_fd, AMD2P2PTEST_IOCTL_GET_PAGE_SIZE, &get_page_size); - if (ret < 0) + if (ret != 0) { fprintf(stderr, "AMD2P2PTEST_IOCTL_GET_PAGE_SIZE error (errno=%d/%s)\n", @@ -146,7 +146,7 @@ void run_rdma_tests(HSAuint32 Node, HsaMemoryProperties *MemoryProperty) ret = ioctl(rdma_fd, AMD2P2PTEST_IOCTL_GET_PAGES, &get_cpu_ptr); - if (ret < 0) + if (ret != 0) { fprintf(stderr, "AMD2P2PTEST_IOCTL_GET_PAGES error (errno=%d/%s)\n", ret, strerror(ret)); diff --git a/tests/rdma/simple/drv/amdp2ptest.c b/tests/rdma/simple/drv/amdp2ptest.c index 788185ae73..c504393c10 100644 --- a/tests/rdma/simple/drv/amdp2ptest.c +++ b/tests/rdma/simple/drv/amdp2ptest.c @@ -183,8 +183,7 @@ static int ioctl_get_page_size(struct file *filp, unsigned long arg) params.page_size = page_size; MSG_INFO("Page size %llx\n", params.page_size); - if (result && copy_to_user((void *)arg, ¶ms, - sizeof(params))) { + if (copy_to_user((void *)arg, ¶ms, sizeof(params))) { MSG_ERR("copy_to_user failed on user pointer %p\n", (void *)arg);