diff mbox series

[linux-next] sysctl: add comments to make the code more clear

Message ID 20211222115135.485298-1-xu.xin16@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series [linux-next] sysctl: add comments to make the code more clear | expand

Commit Message

CGEL Dec. 22, 2021, 11:51 a.m. UTC
From: xu xin <xu.xin16@zte.com.cn>

Adding some comments for ctl_table is more clear.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
---
 include/linux/sysctl.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 180adf7da785..105b18a290c4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -131,14 +131,14 @@  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 */
-	void *data;
-	int maxlen;
-	umode_t mode;
+	void *data;			/* a pointer to data for use by proc_handler */
+	int maxlen;			/* the maximum size in bytes of the data */
+	umode_t mode;			/* the file permissions for the /proc/sys file */
 	struct ctl_table *child;	/* Deprecated */
 	proc_handler *proc_handler;	/* Callback for text formatting */
-	struct ctl_table_poll *poll;
+	struct ctl_table_poll *poll;	/* Support for userspace poll() to watch for changes */
 	void *extra1;
-	void *extra2;
+	void *extra2;			/* extra pointers usually as minimum and maximum of data */
 } __randomize_layout;
 
 struct ctl_node {