Commit 3d51cd8e authored by Luis Chamberlain's avatar Luis Chamberlain

utsname: simplify one-level sysctl registration for uts_kern_table

There is no need to declare an extra tables to just create directory,
this can be easily be done with a prefix path with register_sysctl().

Simplify this registration.
Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent 02148ff3
...@@ -123,15 +123,6 @@ static struct ctl_table uts_kern_table[] = { ...@@ -123,15 +123,6 @@ static struct ctl_table uts_kern_table[] = {
{} {}
}; };
static struct ctl_table uts_root_table[] = {
{
.procname = "kernel",
.mode = 0555,
.child = uts_kern_table,
},
{}
};
#ifdef CONFIG_PROC_SYSCTL #ifdef CONFIG_PROC_SYSCTL
/* /*
* Notify userspace about a change in a certain entry of uts_kern_table, * Notify userspace about a change in a certain entry of uts_kern_table,
...@@ -147,7 +138,7 @@ void uts_proc_notify(enum uts_proc proc) ...@@ -147,7 +138,7 @@ void uts_proc_notify(enum uts_proc proc)
static int __init utsname_sysctl_init(void) static int __init utsname_sysctl_init(void)
{ {
register_sysctl_table(uts_root_table); register_sysctl("kernel", uts_kern_table);
return 0; return 0;
} }
......
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