[CRIU] [PATCH 04/12] compel: Mark compat argument of __NR() as used

Dmitry Safonov dima at arista.com
Sun Nov 10 01:20:37 MSK 2019


And remove __maybe_unused work-around.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 compel/arch/aarch64/src/lib/include/syscall.h               | 2 +-
 compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h | 2 +-
 compel/arch/arm/src/lib/include/syscall.h                   | 2 +-
 compel/arch/arm/src/lib/include/uapi/asm/infect-types.h     | 2 +-
 compel/arch/ppc64/src/lib/include/syscall.h                 | 2 +-
 compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h   | 2 +-
 compel/arch/s390/src/lib/include/uapi/asm/infect-types.h    | 2 +-
 compel/src/lib/infect.c                                     | 4 ++--
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/compel/arch/aarch64/src/lib/include/syscall.h b/compel/arch/aarch64/src/lib/include/syscall.h
index e2ec1272ecf7..30290667afdd 100644
--- a/compel/arch/aarch64/src/lib/include/syscall.h
+++ b/compel/arch/aarch64/src/lib/include/syscall.h
@@ -1,4 +1,4 @@
 #ifndef __COMPEL_SYSCALL_H__
 #define __COMPEL_SYSCALL_H__
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 #endif
diff --git a/compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h b/compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h
index 4662f76897a7..7a33baa8ef2c 100644
--- a/compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h
+++ b/compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h
@@ -27,6 +27,6 @@ typedef struct user_fpsimd_state	user_fpregs_struct_t;
 
 #define ARCH_SI_TRAP		TRAP_BRKPT
 
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 
 #endif /* UAPI_COMPEL_ASM_TYPES_H__ */
diff --git a/compel/arch/arm/src/lib/include/syscall.h b/compel/arch/arm/src/lib/include/syscall.h
index e2ec1272ecf7..30290667afdd 100644
--- a/compel/arch/arm/src/lib/include/syscall.h
+++ b/compel/arch/arm/src/lib/include/syscall.h
@@ -1,4 +1,4 @@
 #ifndef __COMPEL_SYSCALL_H__
 #define __COMPEL_SYSCALL_H__
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 #endif
diff --git a/compel/arch/arm/src/lib/include/uapi/asm/infect-types.h b/compel/arch/arm/src/lib/include/uapi/asm/infect-types.h
index b8286d4049c3..69222b251fc2 100644
--- a/compel/arch/arm/src/lib/include/uapi/asm/infect-types.h
+++ b/compel/arch/arm/src/lib/include/uapi/asm/infect-types.h
@@ -61,6 +61,6 @@ struct user_vfp_exc {
 
 #define ARCH_SI_TRAP		TRAP_BRKPT
 
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 
 #endif /* UAPI_COMPEL_ASM_TYPES_H__ */
diff --git a/compel/arch/ppc64/src/lib/include/syscall.h b/compel/arch/ppc64/src/lib/include/syscall.h
index e2ec1272ecf7..30290667afdd 100644
--- a/compel/arch/ppc64/src/lib/include/syscall.h
+++ b/compel/arch/ppc64/src/lib/include/syscall.h
@@ -1,4 +1,4 @@
 #ifndef __COMPEL_SYSCALL_H__
 #define __COMPEL_SYSCALL_H__
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 #endif
diff --git a/compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h b/compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h
index 89fc4aa3c4f6..126fa2ea31e1 100644
--- a/compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h
+++ b/compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h
@@ -81,6 +81,6 @@ typedef struct {
 
 #define ARCH_SI_TRAP TRAP_BRKPT
 
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 
 #endif /* UAPI_COMPEL_ASM_TYPES_H__ */
diff --git a/compel/arch/s390/src/lib/include/uapi/asm/infect-types.h b/compel/arch/s390/src/lib/include/uapi/asm/infect-types.h
index fddf65d3b0e6..8171d3395136 100644
--- a/compel/arch/s390/src/lib/include/uapi/asm/infect-types.h
+++ b/compel/arch/s390/src/lib/include/uapi/asm/infect-types.h
@@ -73,7 +73,7 @@ typedef struct {
 
 #define user_regs_native(pregs)		true
 
-#define __NR(syscall, compat)	__NR_##syscall
+#define __NR(syscall, compat) ({ (void)compat; __NR_##syscall; })
 
 struct mmap_arg_struct {
 	unsigned long addr;
diff --git a/compel/src/lib/infect.c b/compel/src/lib/infect.c
index f726a9895b02..656cc030d402 100644
--- a/compel/src/lib/infect.c
+++ b/compel/src/lib/infect.c
@@ -720,7 +720,7 @@ static int parasite_mmap_exchange(struct parasite_ctl *ctl, unsigned long size)
 
 static void parasite_memfd_close(struct parasite_ctl *ctl, int fd)
 {
-	bool __maybe_unused compat = !compel_mode_native(ctl);
+	bool compat = !compel_mode_native(ctl);
 	long ret;
 	int err;
 
@@ -732,7 +732,7 @@ static void parasite_memfd_close(struct parasite_ctl *ctl, int fd)
 static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size)
 {
 	void *where = (void *)ctl->ictx.syscall_ip + BUILTIN_SYSCALL_SIZE;
-	bool __maybe_unused compat_task = !compel_mode_native(ctl);
+	bool compat_task = !compel_mode_native(ctl);
 	uint8_t orig_code[MEMFD_FNAME_SZ] = MEMFD_FNAME;
 	pid_t pid = ctl->rpid;
 	long sret = -ENOSYS;
-- 
2.24.0



More information about the CRIU mailing list