diff options
author | Luis Chamberlain <mcgrof@kernel.org> | 2023-03-10 15:45:25 -0800 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2023-03-20 10:56:49 +0100 |
commit | 7db12246306ea601809f22b26d7c2093dd80e146 (patch) | |
tree | 951768eb00a691449246c5919daa49fe1cc981a9 /tools/perf/scripts/python/export-to-postgresql.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, ...).
[gor@linux.ibm.com: appldata_generic_handler fixup ctl_table index 2->0]
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20230310234525.3986352-7-mcgrof@kernel.org
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions