Commit b22d81fb authored by Joel Granados's avatar Joel Granados
Browse files

alloc_tag: move memory_allocation_profiling_sysctls into .rodata



Remove the change in file mode permissions done before initializing the
sysctl. It is not necessary as the writing of the kernel variable will
be blocked by the proc_mem_profiling_handler when writing is disallowed
(also controlled by mem_profiling_support).

Acked-by: default avatarSuren Baghdasaryan <surenb@google.com>
Signed-off-by: default avatarJoel Granados <joel.granados@kernel.org>
parent 48640105
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -783,7 +783,7 @@ static int proc_mem_profiling_handler(const struct ctl_table *table, int write,
}


static struct ctl_table memory_allocation_profiling_sysctls[] = {
static const struct ctl_table memory_allocation_profiling_sysctls[] = {
	{
		.procname	= "mem_profiling",
		.data		= &mem_alloc_profiling_key,
@@ -798,9 +798,6 @@ static struct ctl_table memory_allocation_profiling_sysctls[] = {

static void __init sysctl_init(void)
{
	if (!mem_profiling_support)
		memory_allocation_profiling_sysctls[0].mode = 0444;

	register_sysctl_init("vm", memory_allocation_profiling_sysctls);
}
#else /* CONFIG_SYSCTL */