Skip to content

Commit c522401

Browse files
author
Al Viro
committed
regset(): kill ->get_size()
not used anymore Signed-off-by: Al Viro <[email protected]>
1 parent 1e6986c commit c522401

File tree

2 files changed

+1
-60
lines changed

2 files changed

+1
-60
lines changed

arch/arm64/kernel/ptrace.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -740,18 +740,6 @@ static unsigned int sve_size_from_header(struct user_sve_header const *header)
740740
return ALIGN(header->size, SVE_VQ_BYTES);
741741
}
742742

743-
static unsigned int sve_get_size(struct task_struct *target,
744-
const struct user_regset *regset)
745-
{
746-
struct user_sve_header header;
747-
748-
if (!system_supports_sve())
749-
return 0;
750-
751-
sve_init_header_from_task(&header, target);
752-
return sve_size_from_header(&header);
753-
}
754-
755743
static int sve_get(struct task_struct *target,
756744
const struct user_regset *regset,
757745
struct membuf to)
@@ -1130,7 +1118,6 @@ static const struct user_regset aarch64_regsets[] = {
11301118
.align = SVE_VQ_BYTES,
11311119
.regset_get = sve_get,
11321120
.set = sve_set,
1133-
.get_size = sve_get_size,
11341121
},
11351122
#endif
11361123
#ifdef CONFIG_ARM64_PTR_AUTH

include/linux/regset.h

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,6 @@ typedef int user_regset_writeback_fn(struct task_struct *target,
132132
const struct user_regset *regset,
133133
int immediate);
134134

135-
/**
136-
* user_regset_get_size_fn - type of @get_size function in &struct user_regset
137-
* @target: thread being examined
138-
* @regset: regset being examined
139-
*
140-
* This call is optional; usually the pointer is %NULL.
141-
*
142-
* When provided, this function must return the current size of regset
143-
* data, as observed by the @get function in &struct user_regset. The
144-
* value returned must be a multiple of @size. The returned size is
145-
* required to be valid only until the next time (if any) @regset is
146-
* modified for @target.
147-
*
148-
* This function is intended for dynamically sized regsets. A regset
149-
* that is statically sized does not need to implement it.
150-
*
151-
* This function should not be called directly: instead, callers should
152-
* call regset_size() to determine the current size of a regset.
153-
*/
154-
typedef unsigned int user_regset_get_size_fn(struct task_struct *target,
155-
const struct user_regset *regset);
156-
157135
/**
158136
* struct user_regset - accessible thread CPU state
159137
* @n: Number of slots (registers).
@@ -165,20 +143,14 @@ typedef unsigned int user_regset_get_size_fn(struct task_struct *target,
165143
* @set: Function to store values.
166144
* @active: Function to report if regset is active, or %NULL.
167145
* @writeback: Function to write data back to user memory, or %NULL.
168-
* @get_size: Function to return the regset's size, or %NULL.
169146
*
170147
* This data structure describes a machine resource we call a register set.
171148
* This is part of the state of an individual thread, not necessarily
172149
* actual CPU registers per se. A register set consists of a number of
173150
* similar slots, given by @n. Each slot is @size bytes, and aligned to
174151
* @align bytes (which is at least @size). For dynamically-sized
175152
* regsets, @n must contain the maximum possible number of slots for the
176-
* regset, and @get_size must point to a function that returns the
177-
* current regset size.
178-
*
179-
* Callers that need to know only the current size of the regset and do
180-
* not care about its internal structure should call regset_size()
181-
* instead of inspecting @n or calling @get_size.
153+
* regset.
182154
*
183155
* For backward compatibility, the @get and @set methods must pad to, or
184156
* accept, @n * @size bytes, even if the current regset size is smaller.
@@ -218,7 +190,6 @@ struct user_regset {
218190
user_regset_set_fn *set;
219191
user_regset_active_fn *active;
220192
user_regset_writeback_fn *writeback;
221-
user_regset_get_size_fn *get_size;
222193
unsigned int n;
223194
unsigned int size;
224195
unsigned int align;
@@ -422,21 +393,4 @@ static inline int copy_regset_from_user(struct task_struct *target,
422393
return regset->set(target, regset, offset, size, NULL, data);
423394
}
424395

425-
/**
426-
* regset_size - determine the current size of a regset
427-
* @target: thread to be examined
428-
* @regset: regset to be examined
429-
*
430-
* Note that the returned size is valid only until the next time
431-
* (if any) @regset is modified for @target.
432-
*/
433-
static inline unsigned int regset_size(struct task_struct *target,
434-
const struct user_regset *regset)
435-
{
436-
if (!regset->get_size)
437-
return regset->n * regset->size;
438-
else
439-
return regset->get_size(target, regset);
440-
}
441-
442396
#endif /* <linux/regset.h> */

0 commit comments

Comments
 (0)