Skip to content

Commit 97de10a

Browse files
Kefeng Wangakpm00
authored andcommitted
mm: memory-failure: move sysctl register in memory_failure_init()
There is already a memory_failure_init(), don't add a new initcall, move register_sysctl_init() into it to cleanup a bit. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kefeng Wang <[email protected]> Acked-by: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 870388d commit 97de10a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

mm/memory-failure.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ const struct attribute_group memory_failure_attr_group = {
123123
.attrs = memory_failure_attr,
124124
};
125125

126-
#ifdef CONFIG_SYSCTL
127126
static struct ctl_table memory_failure_table[] = {
128127
{
129128
.procname = "memory_failure_early_kill",
@@ -146,14 +145,6 @@ static struct ctl_table memory_failure_table[] = {
146145
{ }
147146
};
148147

149-
static int __init memory_failure_sysctl_init(void)
150-
{
151-
register_sysctl_init("vm", memory_failure_table);
152-
return 0;
153-
}
154-
late_initcall(memory_failure_sysctl_init);
155-
#endif /* CONFIG_SYSCTL */
156-
157148
/*
158149
* Return values:
159150
* 1: the page is dissolved (if needed) and taken off from buddy,
@@ -2441,6 +2432,8 @@ static int __init memory_failure_init(void)
24412432
INIT_WORK(&mf_cpu->work, memory_failure_work_func);
24422433
}
24432434

2435+
register_sysctl_init("vm", memory_failure_table);
2436+
24442437
return 0;
24452438
}
24462439
core_initcall(memory_failure_init);

0 commit comments

Comments
 (0)