lkml.org 
[lkml]   [2021]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next] sysctl: add comments to make the code more clear
Date
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 --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 {
--
2.25.1
\
 
 \ /
  Last update: 2021-12-22 12:52    [W:0.029 / U:2.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site