Skip to content

Commit 1e6986c

Browse files
author
Al Viro
committed
regset: kill ->get()
no instances left Signed-off-by: Al Viro <[email protected]>
1 parent dcad785 commit 1e6986c

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

include/linux/regset.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,6 @@ static inline int membuf_write(struct membuf *s, const void *v, size_t size)
8282
typedef int user_regset_active_fn(struct task_struct *target,
8383
const struct user_regset *regset);
8484

85-
/**
86-
* user_regset_get_fn - type of @get function in &struct user_regset
87-
* @target: thread being examined
88-
* @regset: regset being examined
89-
* @pos: offset into the regset data to access, in bytes
90-
* @count: amount of data to copy, in bytes
91-
* @kbuf: if not %NULL, a kernel-space pointer to copy into
92-
* @ubuf: if @kbuf is %NULL, a user-space pointer to copy into
93-
*
94-
* Fetch register values. Return %0 on success; -%EIO or -%ENODEV
95-
* are usual failure returns. The @pos and @count values are in
96-
* bytes, but must be properly aligned. If @kbuf is non-null, that
97-
* buffer is used and @ubuf is ignored. If @kbuf is %NULL, then
98-
* ubuf gives a userland pointer to access directly, and an -%EFAULT
99-
* return value is possible.
100-
*/
101-
typedef int user_regset_get_fn(struct task_struct *target,
102-
const struct user_regset *regset,
103-
unsigned int pos, unsigned int count,
104-
void *kbuf, void __user *ubuf);
105-
10685
typedef int user_regset_get2_fn(struct task_struct *target,
10786
const struct user_regset *regset,
10887
struct membuf to);
@@ -235,7 +214,6 @@ typedef unsigned int user_regset_get_size_fn(struct task_struct *target,
235214
* omitted when there is an @active function and it returns zero.
236215
*/
237216
struct user_regset {
238-
user_regset_get_fn *get;
239217
user_regset_get2_fn *regset_get;
240218
user_regset_set_fn *set;
241219
user_regset_active_fn *active;

kernel/regset.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static int __regset_get(struct task_struct *target,
1111
void *p = *data, *to_free = NULL;
1212
int res;
1313

14-
if (!regset->get && !regset->regset_get)
14+
if (!regset->regset_get)
1515
return -EOPNOTSUPP;
1616
if (size > regset->n * regset->size)
1717
size = regset->n * regset->size;
@@ -20,28 +20,14 @@ static int __regset_get(struct task_struct *target,
2020
if (!p)
2121
return -ENOMEM;
2222
}
23-
if (regset->regset_get) {
24-
res = regset->regset_get(target, regset,
25-
(struct membuf){.p = p, .left = size});
26-
if (res < 0) {
27-
kfree(to_free);
28-
return res;
29-
}
30-
*data = p;
31-
return size - res;
32-
}
33-
res = regset->get(target, regset, 0, size, p, NULL);
34-
if (unlikely(res < 0)) {
23+
res = regset->regset_get(target, regset,
24+
(struct membuf){.p = p, .left = size});
25+
if (res < 0) {
3526
kfree(to_free);
3627
return res;
3728
}
3829
*data = p;
39-
if (regset->get_size) { // arm64-only kludge, will go away
40-
unsigned max_size = regset->get_size(target, regset);
41-
if (size > max_size)
42-
size = max_size;
43-
}
44-
return size;
30+
return size - res;
4531
}
4632

4733
int regset_get(struct task_struct *target,

0 commit comments

Comments
 (0)