Commit de8a660b authored by Joel Granados's avatar Joel Granados Committed by Luis Chamberlain

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%2FcBo@bombadil.infradead.org/)

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: default avatarJoel Granados <j.granados@samsung.com>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent fdd9da76
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
static unsigned int isa_membase, isa_portbase, isa_portshift; static unsigned int isa_membase, isa_portbase, isa_portshift;
static struct ctl_table ctl_isa_vars[4] = { static struct ctl_table ctl_isa_vars[] = {
{ {
.procname = "membase", .procname = "membase",
.data = &isa_membase, .data = &isa_membase,
...@@ -35,7 +35,7 @@ static struct ctl_table ctl_isa_vars[4] = { ...@@ -35,7 +35,7 @@ static struct ctl_table ctl_isa_vars[4] = {
.maxlen = sizeof(isa_portshift), .maxlen = sizeof(isa_portshift),
.mode = 0444, .mode = 0444,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, {} },
}; };
static struct ctl_table_header *isa_sysctl_header; static struct ctl_table_header *isa_sysctl_header;
......
...@@ -52,10 +52,8 @@ struct insn_emulation { ...@@ -52,10 +52,8 @@ struct insn_emulation {
int min; int min;
int max; int max;
/* /* sysctl for this emulation */
* sysctl for this emulation + a sentinal entry. struct ctl_table sysctl;
*/
struct ctl_table sysctl[2];
}; };
#define ARM_OPCODE_CONDTEST_FAIL 0 #define ARM_OPCODE_CONDTEST_FAIL 0
...@@ -558,7 +556,7 @@ static void __init register_insn_emulation(struct insn_emulation *insn) ...@@ -558,7 +556,7 @@ static void __init register_insn_emulation(struct insn_emulation *insn)
update_insn_emulation_mode(insn, INSN_UNDEF); update_insn_emulation_mode(insn, INSN_UNDEF);
if (insn->status != INSN_UNAVAILABLE) { if (insn->status != INSN_UNAVAILABLE) {
sysctl = &insn->sysctl[0]; sysctl = &insn->sysctl;
sysctl->mode = 0644; sysctl->mode = 0644;
sysctl->maxlen = sizeof(int); sysctl->maxlen = sizeof(int);
......
...@@ -589,7 +589,6 @@ static struct ctl_table sve_default_vl_table[] = { ...@@ -589,7 +589,6 @@ static struct ctl_table sve_default_vl_table[] = {
.proc_handler = vec_proc_do_default_vl, .proc_handler = vec_proc_do_default_vl,
.extra1 = &vl_info[ARM64_VEC_SVE], .extra1 = &vl_info[ARM64_VEC_SVE],
}, },
{ }
}; };
static int __init sve_sysctl_init(void) static int __init sve_sysctl_init(void)
...@@ -613,7 +612,6 @@ static struct ctl_table sme_default_vl_table[] = { ...@@ -613,7 +612,6 @@ static struct ctl_table sme_default_vl_table[] = {
.proc_handler = vec_proc_do_default_vl, .proc_handler = vec_proc_do_default_vl,
.extra1 = &vl_info[ARM64_VEC_SME], .extra1 = &vl_info[ARM64_VEC_SME],
}, },
{ }
}; };
static int __init sme_sysctl_init(void) static int __init sme_sysctl_init(void)
......
...@@ -724,7 +724,6 @@ static struct ctl_table tagged_addr_sysctl_table[] = { ...@@ -724,7 +724,6 @@ static struct ctl_table tagged_addr_sysctl_table[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{ }
}; };
static int __init tagged_addr_init(void) static int __init tagged_addr_init(void)
......
...@@ -1175,7 +1175,6 @@ static struct ctl_table armv8_pmu_sysctl_table[] = { ...@@ -1175,7 +1175,6 @@ static struct ctl_table armv8_pmu_sysctl_table[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{ }
}; };
static void armv8_pmu_register_sysctl_table(void) static void armv8_pmu_register_sysctl_table(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment