Skip to content

Commit ce327e1

Browse files
author
Al Viro
committed
regset: kill user_regset_copyout{,_zero}()
no callers left Signed-off-by: Al Viro <[email protected]>
1 parent c522401 commit ce327e1

File tree

1 file changed

+0
-67
lines changed

1 file changed

+0
-67
lines changed

include/linux/regset.h

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -238,44 +238,6 @@ struct user_regset_view {
238238
*/
239239
const struct user_regset_view *task_user_regset_view(struct task_struct *tsk);
240240

241-
242-
/*
243-
* These are helpers for writing regset get/set functions in arch code.
244-
* Because @start_pos and @end_pos are always compile-time constants,
245-
* these are inlined into very little code though they look large.
246-
*
247-
* Use one or more calls sequentially for each chunk of regset data stored
248-
* contiguously in memory. Call with constants for @start_pos and @end_pos,
249-
* giving the range of byte positions in the regset that data corresponds
250-
* to; @end_pos can be -1 if this chunk is at the end of the regset layout.
251-
* Each call updates the arguments to point past its chunk.
252-
*/
253-
254-
static inline int user_regset_copyout(unsigned int *pos, unsigned int *count,
255-
void **kbuf,
256-
void __user **ubuf, const void *data,
257-
const int start_pos, const int end_pos)
258-
{
259-
if (*count == 0)
260-
return 0;
261-
BUG_ON(*pos < start_pos);
262-
if (end_pos < 0 || *pos < end_pos) {
263-
unsigned int copy = (end_pos < 0 ? *count
264-
: min(*count, end_pos - *pos));
265-
data += *pos - start_pos;
266-
if (*kbuf) {
267-
memcpy(*kbuf, data, copy);
268-
*kbuf += copy;
269-
} else if (__copy_to_user(*ubuf, data, copy))
270-
return -EFAULT;
271-
else
272-
*ubuf += copy;
273-
*pos += copy;
274-
*count -= copy;
275-
}
276-
return 0;
277-
}
278-
279241
static inline int user_regset_copyin(unsigned int *pos, unsigned int *count,
280242
const void **kbuf,
281243
const void __user **ubuf, void *data,
@@ -301,35 +263,6 @@ static inline int user_regset_copyin(unsigned int *pos, unsigned int *count,
301263
return 0;
302264
}
303265

304-
/*
305-
* These two parallel the two above, but for portions of a regset layout
306-
* that always read as all-zero or for which writes are ignored.
307-
*/
308-
static inline int user_regset_copyout_zero(unsigned int *pos,
309-
unsigned int *count,
310-
void **kbuf, void __user **ubuf,
311-
const int start_pos,
312-
const int end_pos)
313-
{
314-
if (*count == 0)
315-
return 0;
316-
BUG_ON(*pos < start_pos);
317-
if (end_pos < 0 || *pos < end_pos) {
318-
unsigned int copy = (end_pos < 0 ? *count
319-
: min(*count, end_pos - *pos));
320-
if (*kbuf) {
321-
memset(*kbuf, 0, copy);
322-
*kbuf += copy;
323-
} else if (clear_user(*ubuf, copy))
324-
return -EFAULT;
325-
else
326-
*ubuf += copy;
327-
*pos += copy;
328-
*count -= copy;
329-
}
330-
return 0;
331-
}
332-
333266
static inline int user_regset_copyin_ignore(unsigned int *pos,
334267
unsigned int *count,
335268
const void **kbuf,

0 commit comments

Comments
 (0)