2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-02 07:15:31 +00:00

crtools.c: fix compilation by clang

Fix the following error:

> >   LINK     arch/x86/syscalls.built-in.o
> > arch/x86/crtools.c:36:20: error: unused function '__check_code_syscall'
> >       [-Werror,-Wunused-function]
> > static inline void __check_code_syscall(void)

As the function consists of a few BUILD_BUG_ONs, it gets optimized out.
Let's add __attribute__((__unused__)) so clang stops complaining.

[v2: s/used/unused/, fix all the arches, whitespace cleanup]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Kir Kolyshkin
2015-05-02 00:15:00 +03:00
committed by Pavel Emelyanov
parent 43fb948400
commit 3ea2fd78eb
3 changed files with 3 additions and 5 deletions

View File

@@ -30,13 +30,12 @@ const char code_syscall[] = {
const int code_syscall_size = round_up(sizeof(code_syscall), sizeof(long)); const int code_syscall_size = round_up(sizeof(code_syscall), sizeof(long));
static inline void __check_code_syscall(void) static inline void __always_unused __check_code_syscall(void)
{ {
BUILD_BUG_ON(sizeof(code_syscall) != BUILTIN_SYSCALL_SIZE); BUILD_BUG_ON(sizeof(code_syscall) != BUILTIN_SYSCALL_SIZE);
BUILD_BUG_ON(!is_log2(sizeof(code_syscall))); BUILD_BUG_ON(!is_log2(sizeof(code_syscall)));
} }
void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs) void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs)
{ {
regs->pc = new_ip; regs->pc = new_ip;

View File

@@ -30,13 +30,12 @@ const char code_syscall[] = {
const int code_syscall_size = round_up(sizeof(code_syscall), sizeof(long)); const int code_syscall_size = round_up(sizeof(code_syscall), sizeof(long));
static inline void __check_code_syscall(void) static inline __always_unused void __check_code_syscall(void)
{ {
BUILD_BUG_ON(sizeof(code_syscall) != BUILTIN_SYSCALL_SIZE); BUILD_BUG_ON(sizeof(code_syscall) != BUILTIN_SYSCALL_SIZE);
BUILD_BUG_ON(!is_log2(sizeof(code_syscall))); BUILD_BUG_ON(!is_log2(sizeof(code_syscall)));
} }
void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs) void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs)
{ {
regs->ARM_pc = new_ip; regs->ARM_pc = new_ip;

View File

@@ -33,7 +33,7 @@ const char code_syscall[] = {
const int code_syscall_size = round_up(sizeof(code_syscall), sizeof(long)); const int code_syscall_size = round_up(sizeof(code_syscall), sizeof(long));
static inline void __check_code_syscall(void) static inline __always_unused void __check_code_syscall(void)
{ {
BUILD_BUG_ON(sizeof(code_syscall) != BUILTIN_SYSCALL_SIZE); BUILD_BUG_ON(sizeof(code_syscall) != BUILTIN_SYSCALL_SIZE);
BUILD_BUG_ON(!is_log2(sizeof(code_syscall))); BUILD_BUG_ON(!is_log2(sizeof(code_syscall)));