]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
S390: Remove now superfluous sentinel elem from ctl_table arrays
authorJoel Granados <j.granados@samsung.com>
Mon, 2 Oct 2023 11:30:36 +0000 (13:30 +0200)
committerLuis Chamberlain <mcgrof@kernel.org>
Tue, 10 Oct 2023 22:22:02 +0000 (15:22 -0700)
This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which will
reduce the overall build time size of the kernel and run time memory
bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)

Remove the sentinel element from appldata_table, s390dbf_table,
topology_ctl_table, cmm_table and page_table_sysctl. Reduced the memory
allocation in appldata_register_ops by 1 effectively removing the
sentinel from ops->ctl_table.

This removal is safe because register_sysctl_sz and register_sysctl use
the array size in addition to checking for the sentinel.

Tested-by: Alexander Gordeev <agordeev@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
arch/s390/appldata/appldata_base.c
arch/s390/kernel/debug.c
arch/s390/kernel/topology.c
arch/s390/mm/cmm.c
arch/s390/mm/pgalloc.c

index 3b0994625652a6867acd35dc25265e00e00a3e23..c2978cb03b3676cea3460d93a4706494a01fa111 100644 (file)
@@ -63,7 +63,6 @@ static struct ctl_table appldata_table[] = {
                .mode           = S_IRUGO | S_IWUSR,
                .proc_handler   = appldata_interval_handler,
        },
-       { },
 };
 
 /*
@@ -351,8 +350,7 @@ int appldata_register_ops(struct appldata_ops *ops)
        if (ops->size > APPLDATA_MAX_REC_SIZE)
                return -EINVAL;
 
-       /* The last entry must be an empty one */
-       ops->ctl_table = kcalloc(2, sizeof(struct ctl_table), GFP_KERNEL);
+       ops->ctl_table = kcalloc(1, sizeof(struct ctl_table), GFP_KERNEL);
        if (!ops->ctl_table)
                return -ENOMEM;
 
index a85e0c3e7027f84e6f103f22e7786d847c44ca7d..85328a0ef3b6bf4eb51ac19251427c3ea193e34f 100644 (file)
@@ -978,7 +978,6 @@ static struct ctl_table s390dbf_table[] = {
                .mode           = S_IRUGO | S_IWUSR,
                .proc_handler   = s390dbf_procactive,
        },
-       { }
 };
 
 static struct ctl_table_header *s390dbf_sysctl_header;
index 68adf1de8888b25fbfaea0a45537e8cd4fb21c2f..be8467b2595399ac10c608cf878026a932559de5 100644 (file)
@@ -636,7 +636,6 @@ static struct ctl_table topology_ctl_table[] = {
                .mode           = 0644,
                .proc_handler   = topology_ctl_handler,
        },
-       { },
 };
 
 static int __init topology_init(void)
index f47515313226c4e3b07f53a43351a8ae6ace2b99..f8b13f24764619da5db1db5474d86115c4a59c23 100644 (file)
@@ -332,7 +332,6 @@ static struct ctl_table cmm_table[] = {
                .mode           = 0644,
                .proc_handler   = cmm_timeout_handler,
        },
-       { }
 };
 
 #ifdef CONFIG_CMM_IUCV
index 07fc660a24aa2f3faa729acf4b174e1c608833df..75e1039f2ec56be3721b6b00d7bc263d13397943 100644 (file)
@@ -30,7 +30,6 @@ static struct ctl_table page_table_sysctl[] = {
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_ONE,
        },
-       { }
 };
 
 static int __init page_table_register_sysctl(void)