]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sysctl: Remove superfluous __do_proc_* indirection
authorJoel Granados <joel.granados@kernel.org>
Thu, 2 Oct 2025 08:50:03 +0000 (10:50 +0200)
committerJoel Granados <joel.granados@kernel.org>
Thu, 27 Nov 2025 14:43:20 +0000 (15:43 +0100)
Remove "__" from __do_proc_do{intvec,uintvec,ulongvec_minmax} internal
functions and delete their corresponding do_proc_do* wrappers. These
indirections are unnecessary as they do not add extra logic nor do they
indicate a layer separation.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
kernel/sysctl.c

index 0e249a1f99fec084db649782f5ef8b37e40c6a7c..9b042d81fd1c6a32f60e2834a98d48c1bc348de0 100644 (file)
@@ -398,11 +398,11 @@ static int do_proc_douintvec_conv(unsigned long *lvalp,
 
 static const char proc_wspace_sep[] = { ' ', '\t', '\n' };
 
-static int __do_proc_dointvec(const struct ctl_table *table, int write,
-                             void *buffer, size_t *lenp, loff_t *ppos,
-                             int (*conv)(bool *negp, unsigned long *lvalp,
-                                         int *valp, int write,
-                                         const struct ctl_table *table))
+
+static int do_proc_dointvec(const struct ctl_table *table, int write,
+                 void *buffer, size_t *lenp, loff_t *ppos,
+                 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
+                             int write, const struct ctl_table *table))
 {
        int *i, vleft, first = 1, err = 0;
        size_t left;
@@ -470,14 +470,6 @@ out:
        return err;
 }
 
-static int do_proc_dointvec(const struct ctl_table *table, int write,
-                 void *buffer, size_t *lenp, loff_t *ppos,
-                 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
-                             int write, const struct ctl_table *table))
-{
-       return __do_proc_dointvec(table, write, buffer, lenp, ppos, conv);
-}
-
 static int do_proc_douintvec_w(const struct ctl_table *table, void *buffer,
                               size_t *lenp, loff_t *ppos,
                               int (*conv)(unsigned long *lvalp,
@@ -526,7 +518,6 @@ out_free:
 
        return 0;
 
-       /* This is in keeping with old __do_proc_dointvec() */
 bail_early:
        *ppos += *lenp;
        return err;
@@ -562,11 +553,10 @@ out:
        return err;
 }
 
-static int __do_proc_douintvec(const struct ctl_table *table, int write,
-                              void *buffer, size_t *lenp, loff_t *ppos,
-                              int (*conv)(unsigned long *lvalp,
-                                          unsigned int *valp, int write,
-                                          const struct ctl_table *table))
+int do_proc_douintvec(const struct ctl_table *table, int write, void *buffer,
+                     size_t *lenp, loff_t *ppos,
+                     int (*conv)(unsigned long *lvalp, unsigned int *valp,
+                                 int write, const struct ctl_table *table))
 {
        unsigned int vleft;
 
@@ -594,15 +584,6 @@ static int __do_proc_douintvec(const struct ctl_table *table, int write,
        return do_proc_douintvec_r(table, buffer, lenp, ppos, conv);
 }
 
-int do_proc_douintvec(const struct ctl_table *table, int write,
-                     void *buffer, size_t *lenp, loff_t *ppos,
-                     int (*conv)(unsigned long *lvalp,
-                                 unsigned int *valp, int write,
-                                 const struct ctl_table *table))
-{
-       return __do_proc_douintvec(table, write, buffer, lenp, ppos, conv);
-}
-
 /**
  * proc_dobool - read/write a bool
  * @table: the sysctl table
@@ -831,9 +812,10 @@ int proc_dou8vec_minmax(const struct ctl_table *table, int write,
 }
 EXPORT_SYMBOL_GPL(proc_dou8vec_minmax);
 
-static int __do_proc_doulongvec_minmax(const struct ctl_table *table,
-               int write, void *buffer, size_t *lenp, loff_t *ppos,
-               unsigned long convmul, unsigned long convdiv)
+static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write,
+                                    void *buffer, size_t *lenp, loff_t *ppos,
+                                    unsigned long convmul,
+                                    unsigned long convdiv)
 {
        unsigned long *i, *min, *max;
        int vleft, first = 1, err = 0;
@@ -904,14 +886,6 @@ out:
        return err;
 }
 
-static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write,
-               void *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul,
-               unsigned long convdiv)
-{
-       return __do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos,
-                                          convmul, convdiv);
-}
-
 /**
  * proc_doulongvec_minmax - read a vector of long integers with min/max values
  * @table: the sysctl table