linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table
@ 2023-03-10 23:16 Luis Chamberlain
  2023-03-11  7:57 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luis Chamberlain @ 2023-03-10 23:16 UTC (permalink / raw)
  To: pvorel, akpm, gregkh, keescook, Jason
  Cc: ebiederm, yzaikin, j.granados, patches, linux-fsdevel,
	linux-kernel, Luis Chamberlain

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.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---

This is part of the effort to phase out calls that can recurse from
sysctl registration [0]. If you have a tree to take this in feel free
to take it, or I can take it too through sysclt-next. Let me know!

This file has no explicit maintainer, so I assume there is no tree.

If I so no one taking it I can take in as part of sysctl-next later.

[0] https://lore.kernel.org/all/20230310223947.3917711-1-mcgrof@kernel.org/T/#u

 kernel/utsname_sysctl.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c
index f50398cb790d..019e3a1566cf 100644
--- a/kernel/utsname_sysctl.c
+++ b/kernel/utsname_sysctl.c
@@ -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,
@@ -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;
 }
 
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table
  2023-03-10 23:16 [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table Luis Chamberlain
@ 2023-03-11  7:57 ` Greg KH
  2023-03-12 19:27 ` Petr Vorel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2023-03-11  7:57 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: pvorel, akpm, keescook, Jason, ebiederm, yzaikin, j.granados,
	patches, linux-fsdevel, linux-kernel

On Fri, Mar 10, 2023 at 03:16:56PM -0800, Luis Chamberlain wrote:
> 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.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

> ---
> 
> This is part of the effort to phase out calls that can recurse from
> sysctl registration [0]. If you have a tree to take this in feel free
> to take it, or I can take it too through sysclt-next. Let me know!
> 
> This file has no explicit maintainer, so I assume there is no tree.
> 
> If I so no one taking it I can take in as part of sysctl-next later.

I recommend taking it in your tree like this, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table
  2023-03-10 23:16 [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table Luis Chamberlain
  2023-03-11  7:57 ` Greg KH
@ 2023-03-12 19:27 ` Petr Vorel
  2023-03-12 20:30 ` Andrew Morton
  2023-03-13 11:20 ` Christian Brauner
  3 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2023-03-12 19:27 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: akpm, gregkh, keescook, Jason, ebiederm, yzaikin, j.granados,
	patches, linux-fsdevel, linux-kernel

Hi Luis,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table
  2023-03-10 23:16 [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table Luis Chamberlain
  2023-03-11  7:57 ` Greg KH
  2023-03-12 19:27 ` Petr Vorel
@ 2023-03-12 20:30 ` Andrew Morton
  2023-03-13 11:20 ` Christian Brauner
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2023-03-12 20:30 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: pvorel, gregkh, keescook, Jason, ebiederm, yzaikin, j.granados,
	patches, linux-fsdevel, linux-kernel

On Fri, 10 Mar 2023 15:16:56 -0800 Luis Chamberlain <mcgrof@kernel.org> wrote:

> This is part of the effort to phase out calls that can recurse from
> sysctl registration [0]. If you have a tree to take this in feel free
> to take it, or I can take it too through sysclt-next. Let me know!
> 
> This file has no explicit maintainer, so I assume there is no tree.

I act as a backstop for such changes, if people cc me.

> If I so no one taking it I can take in as part of sysctl-next later.

Please do that.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table
  2023-03-10 23:16 [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table Luis Chamberlain
                   ` (2 preceding siblings ...)
  2023-03-12 20:30 ` Andrew Morton
@ 2023-03-13 11:20 ` Christian Brauner
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Brauner @ 2023-03-13 11:20 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: pvorel, akpm, gregkh, keescook, Jason, ebiederm, yzaikin,
	j.granados, patches, linux-fsdevel, linux-kernel

On Fri, Mar 10, 2023 at 03:16:56PM -0800, Luis Chamberlain wrote:
> 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.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---

Looks good,
Reviewed-by: Christian Brauner <brauner@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-13 11:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 23:16 [PATCH] utsname: simplify one-level sysctl registration for uts_kern_table Luis Chamberlain
2023-03-11  7:57 ` Greg KH
2023-03-12 19:27 ` Petr Vorel
2023-03-12 20:30 ` Andrew Morton
2023-03-13 11:20 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).