OSDN Git Service

bpf: change eBPF helper doc parsing script to allow for smaller indent
authorQuentin Monnet <quentin.monnet@netronome.com>
Thu, 17 May 2018 12:43:56 +0000 (13:43 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 17 May 2018 15:34:43 +0000 (17:34 +0200)
commiteeacb7166df6ed1cffa923ea04c70043285783b8
tree37bf2284966284cd02c6975e7841cc14aee90581
parentb9f672af148bf7a08a6031743156faffd58dbc7e
bpf: change eBPF helper doc parsing script to allow for smaller indent

Documentation for eBPF helpers can be parsed from bpf.h and eventually
turned into a man page. Commit 6f96674dbd8c ("bpf: relax constraints on
formatting for eBPF helper documentation") changed the script used to
parse it, in order to allow for different indent style and to ease the
work for writing documentation for future helpers.

The script currently considers that the first tab can be replaced by 6
to 8 spaces. But the documentation for bpf_fib_lookup() uses a mix of
tabs (for the "Description" part) and of spaces ("Return" part), and
only has 5 space long indent for the latter.

We probably do not want to change the values accepted by the script each
time a new helper gets a new indent style. However, it is worth noting
that with those 5 spaces, the "Description" and "Return" part *look*
aligned in the generated patch and in `git show`, so it is likely other
helper authors will use the same length. Therefore, allow for helper
documentation to use 5 spaces only for the first indent level.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
scripts/bpf_helpers_doc.py