Skip to content

Commit e8f023c

Browse files
committed
Merge tag 'asm-generic-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull asm-generic cleanup from Arnd Bergmann: "This is a single cleanup from Peter Collingbourne, removing some dead code" * tag 'asm-generic-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: arch: remove unused function syscall_set_arguments()
2 parents bf98ecb + 7962c2e commit e8f023c

File tree

18 files changed

+14
-263
lines changed

18 files changed

+14
-263
lines changed

arch/arm/include/asm/syscall.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
7777
memcpy(args, &regs->ARM_r0 + 1, 5 * sizeof(args[0]));
7878
}
7979

80-
static inline void syscall_set_arguments(struct task_struct *task,
81-
struct pt_regs *regs,
82-
const unsigned long *args)
83-
{
84-
regs->ARM_ORIG_r0 = args[0];
85-
args++;
86-
87-
memcpy(&regs->ARM_r0 + 1, args, 5 * sizeof(args[0]));
88-
}
89-
9080
static inline int syscall_get_arch(struct task_struct *task)
9181
{
9282
/* ARM tasks don't change audit architectures on the fly. */

arch/arm64/include/asm/syscall.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
7373
memcpy(args, &regs->regs[1], 5 * sizeof(args[0]));
7474
}
7575

76-
static inline void syscall_set_arguments(struct task_struct *task,
77-
struct pt_regs *regs,
78-
const unsigned long *args)
79-
{
80-
regs->orig_x0 = args[0];
81-
args++;
82-
83-
memcpy(&regs->regs[1], args, 5 * sizeof(args[0]));
84-
}
85-
8676
/*
8777
* We don't care about endianness (__AUDIT_ARCH_LE bit) here because
8878
* AArch64 has the same system calls both on little- and big- endian.

arch/csky/include/asm/syscall.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
5959
memcpy(args, &regs->a1, 5 * sizeof(args[0]));
6060
}
6161

62-
static inline void
63-
syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
64-
const unsigned long *args)
65-
{
66-
regs->orig_a0 = args[0];
67-
args++;
68-
memcpy(&regs->a1, args, 5 * sizeof(regs->a1));
69-
}
70-
7162
static inline int
7263
syscall_get_arch(struct task_struct *task)
7364
{

arch/ia64/include/asm/syscall.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,8 @@ static inline void syscall_set_return_value(struct task_struct *task,
5555
}
5656
}
5757

58-
extern void ia64_syscall_get_set_arguments(struct task_struct *task,
59-
struct pt_regs *regs, unsigned long *args, int rw);
60-
static inline void syscall_get_arguments(struct task_struct *task,
61-
struct pt_regs *regs,
62-
unsigned long *args)
63-
{
64-
ia64_syscall_get_set_arguments(task, regs, args, 0);
65-
}
66-
67-
static inline void syscall_set_arguments(struct task_struct *task,
68-
struct pt_regs *regs,
69-
unsigned long *args)
70-
{
71-
ia64_syscall_get_set_arguments(task, regs, args, 1);
72-
}
58+
extern void syscall_get_arguments(struct task_struct *task,
59+
struct pt_regs *regs, unsigned long *args);
7360

7461
static inline int syscall_get_arch(struct task_struct *task)
7562
{

arch/ia64/kernel/ptrace.c

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,17 +2001,16 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *tsk)
20012001
return &user_ia64_view;
20022002
}
20032003

2004-
struct syscall_get_set_args {
2004+
struct syscall_get_args {
20052005
unsigned int i;
20062006
unsigned int n;
20072007
unsigned long *args;
20082008
struct pt_regs *regs;
2009-
int rw;
20102009
};
20112010

2012-
static void syscall_get_set_args_cb(struct unw_frame_info *info, void *data)
2011+
static void syscall_get_args_cb(struct unw_frame_info *info, void *data)
20132012
{
2014-
struct syscall_get_set_args *args = data;
2013+
struct syscall_get_args *args = data;
20152014
struct pt_regs *pt = args->regs;
20162015
unsigned long *krbs, cfm, ndirty, nlocals, nouts;
20172016
int i, count;
@@ -2042,37 +2041,31 @@ static void syscall_get_set_args_cb(struct unw_frame_info *info, void *data)
20422041
/* Iterate over outs. */
20432042
for (i = 0; i < count; i++) {
20442043
int j = ndirty + nlocals + i + args->i;
2045-
if (args->rw)
2046-
*ia64_rse_skip_regs(krbs, j) = args->args[i];
2047-
else
2048-
args->args[i] = *ia64_rse_skip_regs(krbs, j);
2044+
args->args[i] = *ia64_rse_skip_regs(krbs, j);
20492045
}
20502046

2051-
if (!args->rw) {
2052-
while (i < args->n) {
2053-
args->args[i] = 0;
2054-
i++;
2055-
}
2047+
while (i < args->n) {
2048+
args->args[i] = 0;
2049+
i++;
20562050
}
20572051
}
20582052

2059-
void ia64_syscall_get_set_arguments(struct task_struct *task,
2060-
struct pt_regs *regs, unsigned long *args, int rw)
2053+
void syscall_get_arguments(struct task_struct *task,
2054+
struct pt_regs *regs, unsigned long *args)
20612055
{
2062-
struct syscall_get_set_args data = {
2056+
struct syscall_get_args data = {
20632057
.i = 0,
20642058
.n = 6,
20652059
.args = args,
20662060
.regs = regs,
2067-
.rw = rw,
20682061
};
20692062

20702063
if (task == current)
2071-
unw_init_running(syscall_get_set_args_cb, &data);
2064+
unw_init_running(syscall_get_args_cb, &data);
20722065
else {
20732066
struct unw_frame_info ufi;
20742067
memset(&ufi, 0, sizeof(ufi));
20752068
unw_init_from_blocked_task(&ufi, task);
2076-
syscall_get_set_args_cb(&ufi, &data);
2069+
syscall_get_args_cb(&ufi, &data);
20772070
}
20782071
}

arch/microblaze/include/asm/syscall.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,6 @@ static inline microblaze_reg_t microblaze_get_syscall_arg(struct pt_regs *regs,
5858
return ~0;
5959
}
6060

61-
static inline void microblaze_set_syscall_arg(struct pt_regs *regs,
62-
unsigned int n,
63-
unsigned long val)
64-
{
65-
switch (n) {
66-
case 5:
67-
regs->r10 = val;
68-
case 4:
69-
regs->r9 = val;
70-
case 3:
71-
regs->r8 = val;
72-
case 2:
73-
regs->r7 = val;
74-
case 1:
75-
regs->r6 = val;
76-
case 0:
77-
regs->r5 = val;
78-
default:
79-
BUG();
80-
}
81-
}
82-
8361
static inline void syscall_get_arguments(struct task_struct *task,
8462
struct pt_regs *regs,
8563
unsigned long *args)
@@ -91,17 +69,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
9169
*args++ = microblaze_get_syscall_arg(regs, i++);
9270
}
9371

94-
static inline void syscall_set_arguments(struct task_struct *task,
95-
struct pt_regs *regs,
96-
const unsigned long *args)
97-
{
98-
unsigned int i = 0;
99-
unsigned int n = 6;
100-
101-
while (n--)
102-
microblaze_set_syscall_arg(regs, i++, *args++);
103-
}
104-
10572
asmlinkage unsigned long do_syscall_trace_enter(struct pt_regs *regs);
10673
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
10774

arch/nds32/include/asm/syscall.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,6 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
132132
memcpy(args, &regs->uregs[0] + 1, 5 * sizeof(args[0]));
133133
}
134134

135-
/**
136-
* syscall_set_arguments - change system call parameter value
137-
* @task: task of interest, must be in system call entry tracing
138-
* @regs: task_pt_regs() of @task
139-
* @args: array of argument values to store
140-
*
141-
* Changes 6 arguments to the system call. The first argument gets value
142-
* @args[0], and so on.
143-
*
144-
* It's only valid to call this when @task is stopped for tracing on
145-
* entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
146-
*/
147-
static inline void
148-
syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
149-
const unsigned long *args)
150-
{
151-
regs->orig_r0 = args[0];
152-
args++;
153-
154-
memcpy(&regs->uregs[0] + 1, args, 5 * sizeof(args[0]));
155-
}
156-
157135
static inline int
158136
syscall_get_arch(struct task_struct *task)
159137
{

arch/nios2/include/asm/syscall.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
5858
*args = regs->r9;
5959
}
6060

61-
static inline void syscall_set_arguments(struct task_struct *task,
62-
struct pt_regs *regs, const unsigned long *args)
63-
{
64-
regs->r4 = *args++;
65-
regs->r5 = *args++;
66-
regs->r6 = *args++;
67-
regs->r7 = *args++;
68-
regs->r8 = *args++;
69-
regs->r9 = *args;
70-
}
71-
7261
static inline int syscall_get_arch(struct task_struct *task)
7362
{
7463
return AUDIT_ARCH_NIOS2;

arch/openrisc/include/asm/syscall.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
5757
memcpy(args, &regs->gpr[3], 6 * sizeof(args[0]));
5858
}
5959

60-
static inline void
61-
syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
62-
const unsigned long *args)
63-
{
64-
memcpy(&regs->gpr[3], args, 6 * sizeof(args[0]));
65-
}
66-
6760
static inline int syscall_get_arch(struct task_struct *task)
6861
{
6962
return AUDIT_ARCH_OPENRISC;

arch/powerpc/include/asm/syscall.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
103103
}
104104
}
105105

106-
static inline void syscall_set_arguments(struct task_struct *task,
107-
struct pt_regs *regs,
108-
const unsigned long *args)
109-
{
110-
memcpy(&regs->gpr[3], args, 6 * sizeof(args[0]));
111-
112-
/* Also copy the first argument into orig_gpr3 */
113-
regs->orig_gpr3 = args[0];
114-
}
115-
116106
static inline int syscall_get_arch(struct task_struct *task)
117107
{
118108
if (is_32bit_task())

0 commit comments

Comments
 (0)