From b75bc4635196aa75be828ca936349934a48fd21a Mon Sep 17 00:00:00 2001 From: yzewei Date: Fri, 19 Apr 2024 11:50:08 +0800 Subject: [PATCH] update ifdef to ifndef Signed-off-by: yzewei --- .../syscall_exit_suite/open_by_handle_at_x.cpp | 9 +++------ .../test_suites/syscall_exit_suite/openat2_x.cpp | 12 ++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/test/drivers/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp b/test/drivers/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp index 16996c82e6f..223da90b911 100644 --- a/test/drivers/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp @@ -99,12 +99,11 @@ void do___open_by_handle_atX_success(int *open_by_handle_fd, int *dirfd, char *f } } +#ifndef __loongarch64 /* * 6. Get dev and ino. */ struct stat file_stat; -#if defined(__loongarch64) -#else assert_syscall_state(SYSCALL_SUCCESS, "fstat", syscall(__NR_fstat, *open_by_handle_fd, &file_stat), NOT_EQUAL, -1); *dev = (uint32_t)file_stat.st_dev; *inode = file_stat.st_ino; @@ -189,8 +188,7 @@ TEST(SyscallExit, open_by_handle_atX_success) /* Parameter 4: path (type: PT_FSPATH) */ evt_test->assert_charbuf_param(4, fspath); -#if defined(__loongarch64) -#elif +#ifndef __loongarch64 /* Parameter 5: dev (type: PT_UINT32) */ evt_test->assert_numeric_param(5, dev); @@ -248,8 +246,7 @@ TEST(SyscallExit, open_by_handle_atX_success_mp) /* Parameter 4: path (type: PT_FSPATH) */ evt_test->assert_charbuf_param(4, fspath); -#if defined(__loongarch64) -#elif +#ifndef __loongarch64 /* Parameter 5: dev (type: PT_UINT32) */ evt_test->assert_numeric_param(5, dev); diff --git a/test/drivers/test_suites/syscall_exit_suite/openat2_x.cpp b/test/drivers/test_suites/syscall_exit_suite/openat2_x.cpp index 82e8aab9ab6..0e337eb5a08 100644 --- a/test/drivers/test_suites/syscall_exit_suite/openat2_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/openat2_x.cpp @@ -24,8 +24,7 @@ TEST(SyscallExit, openat2X_success) int32_t fd = syscall(__NR_openat2, dirfd, pathname, &how, sizeof(struct open_how)); assert_syscall_state(SYSCALL_SUCCESS, "openat2", fd, NOT_EQUAL, -1); -#if defined(__loongarch64) -#elif +#ifndef __loongarch64 /* Call `fstat` to retrieve the `dev` and `ino`. */ struct stat file_stat; assert_syscall_state(SYSCALL_SUCCESS, "fstat", syscall(__NR_fstat, fd, &file_stat), NOT_EQUAL, -1); @@ -69,8 +68,7 @@ TEST(SyscallExit, openat2X_success) /* Parameter 6: resolve (type: PT_FLAGS32) */ evt_test->assert_numeric_param(6, (uint32_t)PPM_RESOLVE_BENEATH | PPM_RESOLVE_NO_MAGICLINKS); -#if defined(__loongarch64) -#elif +#ifndef __loongarch64 /* Parameter 7: dev (type: PT_UINT32) */ evt_test->assert_numeric_param(7, dev); @@ -171,8 +169,7 @@ TEST(SyscallExit, openat2X_create_success) int32_t fd = syscall(__NR_openat2, dirfd, pathname, &how, sizeof(struct open_how)); assert_syscall_state(SYSCALL_SUCCESS, "openat2", fd, NOT_EQUAL, -1); -#if defined(__loongarch64) -#elif +#ifndef __loongarch64 /* Call `fstat` to retrieve the `dev` and `ino`. */ struct stat file_stat; assert_syscall_state(SYSCALL_SUCCESS, "fstat", syscall(__NR_fstat, fd, &file_stat), NOT_EQUAL, -1); @@ -216,8 +213,7 @@ TEST(SyscallExit, openat2X_create_success) /* Parameter 6: resolve (type: PT_FLAGS32) */ evt_test->assert_numeric_param(6, (uint32_t)PPM_RESOLVE_BENEATH | PPM_RESOLVE_NO_MAGICLINKS); -#if defined(__loongarch64) -#elif +#ifndef __loongarch64 /* Parameter 7: dev (type: PT_UINT32) */ evt_test->assert_numeric_param(7, dev);