[PATCH 0/7] sysctl: Replace the converter macros with functions

Joel Granados posted 7 patches 1 month, 3 weeks ago
fs/pipe.c              |  22 +++-
include/linux/sysctl.h | 120 +++-------------------
kernel/sysctl.c        | 274 +++++++++++++++++++++++++++++++++++++++++++++----
kernel/time/jiffies.c  | 134 ++++++++++++++++++++----
4 files changed, 403 insertions(+), 147 deletions(-)
[PATCH 0/7] sysctl: Replace the converter macros with functions
Posted by Joel Granados 1 month, 3 weeks ago
Remove all the macros that were created to get jiffies out of sysctl.c.
In [1] we leaned a bit too hard on macros to generate the converter
functions needed in jiffies.c, pipe.c and sysctl.c. In this series we
replace the macros with regular functions to help in debugging and to
better align with coding-style.rst. This series has been tested with
sysctl self tests (x86_64) and with 0-day.

A note about checkpatch: It really dislikes the use of -ENOSYS and
unused arguments in the no-op versions of the functions. These are all
false positives IMO as -ENOSYS should be returned to the syscall that is
reading or writing the proc file.

Comments are greatly appreciated

Best

[1] https://lore.kernel.org/all/tqz52ig2b5jas3qqt6jqqek7uwyg64ny5qnwy6gclhgjcy4ltb@s7jiay5vyomg/

Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
Joel Granados (7):
      sysctl: Return -ENOSYS from proc_douintvec_conv when CONFIG_PROC_SYSCTL=n
      sysctl: clarify proc_douintvec_minmax doc
      sysctl: Add CONFIG_PROC_SYSCTL guards for converter macros
      sysctl: Replace UINT converter macros with functions
      sysctl: Add kernel doc to proc_douintvec_conv
      sysctl: Replace unidirectional INT converter macros with functions
      sysctl: replace SYSCTL_INT_CONV_CUSTOM macro with functions

 fs/pipe.c              |  22 +++-
 include/linux/sysctl.h | 120 +++-------------------
 kernel/sysctl.c        | 274 +++++++++++++++++++++++++++++++++++++++++++++----
 kernel/time/jiffies.c  | 134 ++++++++++++++++++++----
 4 files changed, 403 insertions(+), 147 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251216-jag-no-macro-conv-3a55e69cccd8

Best regards,
-- 
Joel Granados <joel.granados@kernel.org>