Skip to contentSkip to conversation

sysctl: update comments to new registration APIs

PATCH In review Thomas Weißschuh 3 participants 3 messages Aug 10, 2024 – Oct 23, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysctl: update comments to new registration APIs

The sysctl registration APIs do not need a terminating table entry anymore and with commit acc154691fc7 ("sysctl: Warn on an empty procname element") even emit warnings if such a sentinel entry is supplied.

While at it also remove the mention of "table->de" which was removed in
commit 3fbfa98112fc ("[PATCH] sysctl: remove the proc_dir_entry member for the sysctl tables") back in 2007.

---
 include/linux/sysctl.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/sysctl.h +2 -4
index aa4c6d44aaa0..47ca2536865b 100644
@@ -90,9 +90,7 @@ int proc_do_static_key(const struct ctl_table *table, int write, void *buffer,
 
 /*
  * Register a set of sysctl names by calling register_sysctl
- * with an initialised array of struct ctl_table's.  An entry with 
- * NULL procname terminates the table.  table->de will be
- * set up by the registration and need not be initialised in advance.
+ * with an initialised array of struct ctl_table's.
  *
  * sysctl names can be mirrored automatically under /proc/sys.  The
  * procname supplied controls /proc naming.
@@ -133,7 +131,7 @@ static inline void *proc_sys_poll_event(struct ctl_table_poll *poll)
 
 /* A sysctl table is an array of struct ctl_table: */
 struct ctl_table {
-	const char *procname;		/* Text ID for /proc/sys, or zero */
+	const char *procname;		/* Text ID for /proc/sys */
 	void *data;
 	int maxlen;
 	umode_t mode;

---
base-commit: 34ac1e82e5a78d5ed7f647766f5b1b51ca4d983a
change-id: 20240810-sysctl-procname-null-comment-80160bd4089f

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Thomas Weißschuh

The sysctl registration APIs do not need a terminating table entry anymore and with commit acc154691fc7 ("sysctl: Warn on an empty procname element") even emit warnings if such a sentinel entry is supplied.

While at it also remove the mention of "table->de" which was removed in
commit 3fbfa98112fc ("[PATCH] sysctl: remove the proc_dir_entry member for the sysctl tables") back in 2007.

Thanks!

If you're already poking around at these things, it might also be nice to add full kern-doc for these APIs and structs.

Signature · 1 line
Kees Cook
maintainer
#2 lore raw
In reply to Thomas Weißschuh
Quoted 7 lines · Thomas Weißschuh

The sysctl registration APIs do not need a terminating table entry anymore and with commit acc154691fc7 ("sysctl: Warn on an empty procname element") even emit warnings if such a sentinel entry is supplied.

While at it also remove the mention of "table->de" which was removed in
commit 3fbfa98112fc ("[PATCH] sysctl: remove the proc_dir_entry member for the sysctl tables") back in 2007.

I queued this for next release with a slight change in the line lengths to make checkpatch happy. Try to make the paragraphs up to 75 chars next time

Thx

Signature · 1 line
Joel Granados