linux/arch/s390
Luis Chamberlain 7db1224630 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>
2023-03-20 10:56:49 +01:00
..
appldata s390: simplify dynamic sysctl registration for appldata_register_ops 2023-03-20 10:56:49 +01:00
boot s390/decompressor: add link map saving 2023-02-28 13:19:06 +01:00
configs vfio-mdev: turn VFIO_MDEV into a selectable symbol 2023-01-23 11:26:29 -07:00
crypto This update includes the following changes: 2023-02-21 18:10:50 -08:00
hypfs s390/hypfs: remove unused info_blk_hdr__pcpus() function 2022-11-23 16:24:07 +01:00
include s390/setup: always inline gen_lpswe() 2023-03-13 09:16:43 +01:00
kernel s390: simplify one-level syctl registration for s390dbf_table 2023-03-20 10:56:48 +01:00
kvm * Two more V!=R patches 2023-02-15 12:35:26 -05:00
lib s390/kprobes: replace kretprobe with rethook 2023-01-22 18:42:35 +01:00
mm s390: simplify one-level sysctl registration for page_table_sysctl 2023-03-20 10:56:49 +01:00
net s390/bpf: Implement bpf_jit_supports_kfunc_call() 2023-01-29 19:16:29 -08:00
pci s390/pci: clean up left over special treatment for function zero 2023-03-13 09:16:43 +01:00
purgatory s390/purgatory: Remove unused '-MD' and unnecessary '-c' flags 2023-01-26 12:43:05 +09:00
tools
Kbuild
Kconfig s390 updates for 6.3 merge window part 2 2023-03-03 09:38:01 -08:00
Kconfig.debug
Makefile