Skip to content

Commit fdd9da7

Browse files
Joelgranadosmcgrof
authored andcommitted
S390: Remove now superfluous sentinel elem from ctl_table arrays
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%[email protected]/) 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 <[email protected]> Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Joel Granados <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent ce9ecca commit fdd9da7

File tree

5 files changed

+1
-7
lines changed

5 files changed

+1
-7
lines changed

arch/s390/appldata/appldata_base.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ static struct ctl_table appldata_table[] = {
6363
.mode = S_IRUGO | S_IWUSR,
6464
.proc_handler = appldata_interval_handler,
6565
},
66-
{ },
6766
};
6867

6968
/*
@@ -351,8 +350,7 @@ int appldata_register_ops(struct appldata_ops *ops)
351350
if (ops->size > APPLDATA_MAX_REC_SIZE)
352351
return -EINVAL;
353352

354-
/* The last entry must be an empty one */
355-
ops->ctl_table = kcalloc(2, sizeof(struct ctl_table), GFP_KERNEL);
353+
ops->ctl_table = kcalloc(1, sizeof(struct ctl_table), GFP_KERNEL);
356354
if (!ops->ctl_table)
357355
return -ENOMEM;
358356

arch/s390/kernel/debug.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ static struct ctl_table s390dbf_table[] = {
978978
.mode = S_IRUGO | S_IWUSR,
979979
.proc_handler = s390dbf_procactive,
980980
},
981-
{ }
982981
};
983982

984983
static struct ctl_table_header *s390dbf_sysctl_header;

arch/s390/kernel/topology.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,6 @@ static struct ctl_table topology_ctl_table[] = {
636636
.mode = 0644,
637637
.proc_handler = topology_ctl_handler,
638638
},
639-
{ },
640639
};
641640

642641
static int __init topology_init(void)

arch/s390/mm/cmm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ static struct ctl_table cmm_table[] = {
332332
.mode = 0644,
333333
.proc_handler = cmm_timeout_handler,
334334
},
335-
{ }
336335
};
337336

338337
#ifdef CONFIG_CMM_IUCV

arch/s390/mm/pgalloc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ static struct ctl_table page_table_sysctl[] = {
3030
.extra1 = SYSCTL_ZERO,
3131
.extra2 = SYSCTL_ONE,
3232
},
33-
{ }
3433
};
3534

3635
static int __init page_table_register_sysctl(void)

0 commit comments

Comments
 (0)