Skip to content

Commit

Permalink
utsname: simplify one-level sysctl registration for uts_kern_table
Browse files Browse the repository at this point in the history
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: Christian Brauner <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
  • Loading branch information
mcgrof committed Apr 13, 2023
1 parent 02148ff commit 3d51cd8
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions kernel/utsname_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*
* Notify userspace about a change in a certain entry of uts_kern_table,
Expand All @@ -147,7 +138,7 @@ void uts_proc_notify(enum uts_proc proc)

static int __init utsname_sysctl_init(void)
{
register_sysctl_table(uts_root_table);
register_sysctl("kernel", uts_kern_table);
return 0;
}

Expand Down

0 comments on commit 3d51cd8

Please sign in to comment.