diff options
author | Luis Chamberlain <[email protected]> | 2023-03-10 15:45:25 -0800 |
---|---|---|
committer | Heiko Carstens <[email protected]> | 2023-03-20 10:56:49 +0100 |
commit | 7db12246306ea601809f22b26d7c2093dd80e146 (patch) | |
tree | 951768eb00a691449246c5919daa49fe1cc981a9 /tools/perf/scripts/python/libxed.py | |
parent | 7ddc873dcb1d05eaafceeb4a2afd53bbb31addb8 (diff) |
s390: simplify dynamic sysctl registration for appldata_register_ops
The routine appldata_register_ops() allocates a sysctl table
with 4 entries. The firsts one, ops->ctl_table[0] is the parent directory
with an empty entry following it, ops->ctl_table[1]. The next entry is
for the ops->name and that is ops->ctl_table[2]. It needs an empty
entry following that, and that is ops->ctl_table[3]. And so hence the
kcalloc(4, sizeof(struct ctl_table), GFP_KERNEL).
We can simplify this considerably since sysctl_register("foo", table)
can create the parent directory for us if it does not exist. So we
can just remove the first two entries and move back the ops->name to
the first entry, and just use kcalloc(2, ...).
[[email protected]: appldata_generic_handler fixup ctl_table index 2->0]
Signed-off-by: Luis Chamberlain <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Vasily Gorbik <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/libxed.py')
0 files changed, 0 insertions, 0 deletions