• Quentin Monnet's avatar
    bpf: relax constraints on formatting for eBPF helper documentation · 6f96674d
    Quentin Monnet authored
    The Python script used to parse and extract eBPF helpers documentation
    from include/uapi/linux/bpf.h expects a very specific formatting for the
    descriptions (single dot represents a space, '>' stands for a tab):
    
        /*
         ...
         *.int bpf_helper(list of arguments)
         *.>    Description
         *.>    >       Start of description
         *.>    >       Another line of description
         *.>    >       And yet another line of description
         *.>    Return
         *.>    >       0 on success, or a negative error in case of failure
         ...
         */
    
    This is too strict, and painful for developers who wants to add
    documentation for new helpers. Worse, it is extremely difficult to check
    that the formatting is correct during reviews. Change the format
    expected by the script and make it more flexible. The script now works
    whether or not the initial space (right after the star) is present, and
    accepts both tabs and white spaces (or a combination of both) for
    indenting description sections and contents.
    
    Concretely, something like the following would now be supported:
    
        /*
         ...
         *int bpf_helper(list of arguments)
         *......Description
         *.>    >       Start of description...
         *>     >       Another line of description
         *..............And yet another line of description
         *>     Return
         *.>    ........0 on success, or a negative error in case of failure
         ...
         */
    
    While at it, remove unnecessary carets from each regex used with match()
    in the script. They are redundant, as match() tries to match from the
    beginning of the string by default.
    
    v2: Remove unnecessary caret when a regex is used with match().
    Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    6f96674d
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...