}
/* Touch the memory while it is being madvised() */
-void *touch(void *unused)
+void *touch(void __unused *unused)
{
char *ptr = (char *)huge_ptr;
return NULL;
}
-void *madv(void *unused)
+void *madv(void __unused *unused)
{
usleep(rand() % 10);
char *huge_ptr;
/* Touch the memory while it is being madvised() */
-void *touch(void *unused)
+void *touch(void __unused *unused)
{
for (int i = 0; i < INLOOP_ITER; i++)
huge_ptr[0] = '.';
return NULL;
}
-void *madv(void *unused)
+void *madv(void __unused *unused)
{
for (int i = 0; i < INLOOP_ITER; i++)
madvise(huge_ptr, mmap_size, MADV_DONTNEED);
* The other hugepage should be flipping from used <-> reserved, because
* of madvise(DONTNEED).
*/
-void *map_extra(void *unused)
+void *map_extra(void __unused *unused)
{
void *ptr;
return NR_RESERVED_PKEYS;
}
-static inline void expect_fault_on_read_execonly_key(void *p1, int pkey)
+static inline void expect_fault_on_read_execonly_key(void __unused *p1, int __unused pkey)
{
}
-static inline void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey)
+static inline void *malloc_pkey_with_mprotect_subpage(long __unused size, int __unused prot,
+ u16 __unused pkey)
{
return PTR_ERR_ENOTSUP;
}
return NR_RESERVED_PKEYS_64K_3KEYS;
}
-static inline void expect_fault_on_read_execonly_key(void *p1, int pkey)
+static inline void expect_fault_on_read_execonly_key(void __unused *p1, int __unused pkey)
{
/*
* powerpc does not allow userspace to change permissions of exec-only
expected_pkey_fault(pkey);
}
-static inline void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey)
+static inline void *malloc_pkey_with_mprotect_subpage(long __unused size, int __unused prot,
+ u16 __unused pkey)
{
return PTR_ERR_ENOTSUP;
}
return set_pkey_bits(PKEY_REG_ALLOW_NONE, 0, PKEY_DISABLE_ACCESS);
}
-static void sigsegv_handler(int signo, siginfo_t *info, void *ucontext)
+static void sigsegv_handler(int __unused signo, siginfo_t *info, void __unused *ucontext)
{
pthread_mutex_lock(&mutex);
syscall_raw(SYS_exit, 0, 0, 0, 0, 0, 0);
}
-static void sigusr1_handler(int signo, siginfo_t *info, void *ucontext)
+static void sigusr1_handler(int __unused signo, siginfo_t *info, void __unused *ucontext)
{
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
}
-static void sigusr2_handler(int signo, siginfo_t *info, void *ucontext)
+static void sigusr2_handler(int __unused signo, siginfo_t __unused *info, void __unused *ucontext)
{
/*
* pkru should be the init_pkru value which enabled MPK 0 so
*/
}
-static void *thread_segv_with_pkey0_disabled(void *ptr)
+static void *thread_segv_with_pkey0_disabled(void __unused *ptr)
{
/* Disable MPK 0 (and all others too) */
__write_pkey_reg(pkey_reg_restrictive_default());
return NULL;
}
-static void *thread_segv_pkuerr_stack(void *ptr)
+static void *thread_segv_pkuerr_stack(void __unused *ptr)
{
/* Disable MPK 0 (and all others too) */
__write_pkey_reg(pkey_reg_restrictive_default());
static int pkey_faults;
static int last_si_pkey = -1;
-static void signal_handler(int signum, siginfo_t *si, void *vucontext)
+static void signal_handler(int __unused signum, siginfo_t *si, void *vucontext)
{
ucontext_t *uctxt = vucontext;
int trapno;
nr_test_fds = 0;
}
-static void test_pkey_alloc_free_attach_pkey0(int *ptr, u16 pkey)
+static void test_pkey_alloc_free_attach_pkey0(int *ptr, u16 __unused pkey)
{
int i, err;
int max_nr_pkey_allocs;
}
/* Assumes that all pkeys other than 'pkey' are unallocated */
-static void test_pkey_syscalls_bad_args(int *ptr, u16 pkey)
+static void test_pkey_syscalls_bad_args(int *ptr, u16 __unused pkey)
{
int err;
int bad_pkey = NR_PKEYS+99;
}
/* Assumes that all pkeys other than 'pkey' are unallocated */
-static void test_pkey_alloc_exhaust(int *ptr, u16 pkey)
+static void test_pkey_alloc_exhaust(int __unused *ptr, u16 __unused pkey)
{
int err;
int allocated_pkeys[NR_PKEYS] = {0};
* a long-running test that continually checks the pkey
* register.
*/
-static void test_pkey_init_state(int *ptr, u16 pkey)
+static void test_pkey_init_state(int __unused *ptr, u16 __unused pkey)
{
int err;
int allocated_pkeys[NR_PKEYS] = {0};
return p1;
}
-static void test_executing_on_unreadable_memory(int *ptr, u16 pkey)
+static void test_executing_on_unreadable_memory(int __unused *ptr, u16 pkey)
{
void *p1;
int scratch;
pkey_assert(!ret);
}
-static void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey)
+static void test_implicit_mprotect_exec_only_memory(int __unused *ptr, u16 __unused pkey)
{
void *p1;
int scratch;
}
#if defined(__i386__) || defined(__x86_64__)
-static void test_ptrace_modifies_pkru(int *ptr, u16 pkey)
+static void test_ptrace_modifies_pkru(int __unused *ptr, u16 __unused pkey)
{
u32 new_pkru;
pid_t child;
#endif
#if defined(__aarch64__)
-static void test_ptrace_modifies_pkru(int *ptr, u16 pkey)
+static void test_ptrace_modifies_pkru(int __unused *ptr, u16 __unused pkey)
{
pid_t child;
int status, ret;