Skip to content

Commit de8a660

Browse files
Joelgranadosmcgrof
authored andcommitted
arm: 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]/) Removed the sentinel as well as the explicit size from ctl_isa_vars. The size is redundant as the initialization sets it. Changed insn_emulation->sysctl from a 2 element array of struct ctl_table to a simple struct. This has no consequence for the sysctl registration as it is forwarded as a pointer. Removed sentinel from sve_defatul_vl_table, sme_default_vl_table, tagged_addr_sysctl_table and armv8_pmu_sysctl_table. This removal is safe because register_sysctl_sz and register_sysctl use the array size in addition to checking for the sentinel. Signed-off-by: Joel Granados <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent fdd9da7 commit de8a660

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

arch/arm/kernel/isa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
static unsigned int isa_membase, isa_portbase, isa_portshift;
1818

19-
static struct ctl_table ctl_isa_vars[4] = {
19+
static struct ctl_table ctl_isa_vars[] = {
2020
{
2121
.procname = "membase",
2222
.data = &isa_membase,
@@ -35,7 +35,7 @@ static struct ctl_table ctl_isa_vars[4] = {
3535
.maxlen = sizeof(isa_portshift),
3636
.mode = 0444,
3737
.proc_handler = proc_dointvec,
38-
}, {}
38+
},
3939
};
4040

4141
static struct ctl_table_header *isa_sysctl_header;

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ struct insn_emulation {
5252
int min;
5353
int max;
5454

55-
/*
56-
* sysctl for this emulation + a sentinal entry.
57-
*/
58-
struct ctl_table sysctl[2];
55+
/* sysctl for this emulation */
56+
struct ctl_table sysctl;
5957
};
6058

6159
#define ARM_OPCODE_CONDTEST_FAIL 0
@@ -558,7 +556,7 @@ static void __init register_insn_emulation(struct insn_emulation *insn)
558556
update_insn_emulation_mode(insn, INSN_UNDEF);
559557

560558
if (insn->status != INSN_UNAVAILABLE) {
561-
sysctl = &insn->sysctl[0];
559+
sysctl = &insn->sysctl;
562560

563561
sysctl->mode = 0644;
564562
sysctl->maxlen = sizeof(int);

arch/arm64/kernel/fpsimd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ static struct ctl_table sve_default_vl_table[] = {
589589
.proc_handler = vec_proc_do_default_vl,
590590
.extra1 = &vl_info[ARM64_VEC_SVE],
591591
},
592-
{ }
593592
};
594593

595594
static int __init sve_sysctl_init(void)
@@ -613,7 +612,6 @@ static struct ctl_table sme_default_vl_table[] = {
613612
.proc_handler = vec_proc_do_default_vl,
614613
.extra1 = &vl_info[ARM64_VEC_SME],
615614
},
616-
{ }
617615
};
618616

619617
static int __init sme_sysctl_init(void)

arch/arm64/kernel/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,6 @@ static struct ctl_table tagged_addr_sysctl_table[] = {
724724
.extra1 = SYSCTL_ZERO,
725725
.extra2 = SYSCTL_ONE,
726726
},
727-
{ }
728727
};
729728

730729
static int __init tagged_addr_init(void)

drivers/perf/arm_pmuv3.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,6 @@ static struct ctl_table armv8_pmu_sysctl_table[] = {
11751175
.extra1 = SYSCTL_ZERO,
11761176
.extra2 = SYSCTL_ONE,
11771177
},
1178-
{ }
11791178
};
11801179

11811180
static void armv8_pmu_register_sysctl_table(void)

0 commit comments

Comments
 (0)