From: Alejandro Colomar <alx.manpages@gmail.com>
To: Quentin Monnet <quentin@isovalent.com>
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
Alexei Starovoitov <ast@kernel.org>, bpf <bpf@vger.kernel.org>,
linux-man <linux-man@vger.kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Greg KH <gregkh@linuxfoundation.org>,
"G. Branden Robinson" <g.branden.robinson@gmail.com>
Subject: [PATCH v2] Fit lines in 80 columns
Date: Mon, 29 Aug 2022 21:58:44 +0200 [thread overview]
Message-ID: <20220829195842.85290-1-alx.manpages@gmail.com> (raw)
In-Reply-To: <20220825175653.131125-1-alx.manpages@gmail.com>
Those lines is used to generate the bpf-helpers(7) manual page.
They are no-fill lines, since they represent code, which means
that the formatter can't break the line, and instead just runs
across the right margin (in most set-ups this means that the pager
will break the line).
Using <fmt> makes it end exactly at the 80-col right margin, both
in the header file, and also in the manual page, and also seems to
be a sensible name to me.
In the other case, the fix has been to separate the variable
definition and its use, as the kernel coding style recommends.
Nacked-by: Alexei Starovoitov <ast@kernel.org>
Cc: bpf <bpf@vger.kernel.org>
Cc: linux-man <linux-man@vger.kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Stanislav Fomichev <sdf@google.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Quentin Monnet <quentin@isovalent.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
include/uapi/linux/bpf.h | 11 ++++++-----
tools/include/uapi/linux/bpf.h | 11 ++++++-----
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index ef78e0e1a754..1443fa2a1915 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -1619,7 +1619,7 @@ union bpf_attr {
*
* ::
*
- * telnet-470 [001] .N.. 419421.045894: 0x00000001: <formatted msg>
+ * telnet-470 [001] .N.. 419421.045894: 0x00000001: <fmt>
*
* In the above:
*
@@ -1636,8 +1636,7 @@ union bpf_attr {
* * ``419421.045894`` is a timestamp.
* * ``0x00000001`` is a fake value used by BPF for the
* instruction pointer register.
- * * ``<formatted msg>`` is the message formatted with
- * *fmt*.
+ * * ``<fmt>`` is the message formatted with *fmt*.
*
* The conversion specifiers supported by *fmt* are similar, but
* more limited than for printk(). They are **%d**, **%i**,
@@ -3860,8 +3859,10 @@ union bpf_attr {
* void bpf_sys_open(struct pt_regs *ctx)
* {
* char buf[PATHLEN]; // PATHLEN is defined to 256
- * int res = bpf_probe_read_user_str(buf, sizeof(buf),
- * ctx->di);
+ * int res;
+ *
+ * res = bpf_probe_read_user_str(buf, sizeof(buf),
+ * ctx->di);
*
* // Consume buf, for example push it to
* // userspace via bpf_perf_event_output(); we
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index ef78e0e1a754..1443fa2a1915 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1619,7 +1619,7 @@ union bpf_attr {
*
* ::
*
- * telnet-470 [001] .N.. 419421.045894: 0x00000001: <formatted msg>
+ * telnet-470 [001] .N.. 419421.045894: 0x00000001: <fmt>
*
* In the above:
*
@@ -1636,8 +1636,7 @@ union bpf_attr {
* * ``419421.045894`` is a timestamp.
* * ``0x00000001`` is a fake value used by BPF for the
* instruction pointer register.
- * * ``<formatted msg>`` is the message formatted with
- * *fmt*.
+ * * ``<fmt>`` is the message formatted with *fmt*.
*
* The conversion specifiers supported by *fmt* are similar, but
* more limited than for printk(). They are **%d**, **%i**,
@@ -3860,8 +3859,10 @@ union bpf_attr {
* void bpf_sys_open(struct pt_regs *ctx)
* {
* char buf[PATHLEN]; // PATHLEN is defined to 256
- * int res = bpf_probe_read_user_str(buf, sizeof(buf),
- * ctx->di);
+ * int res;
+ *
+ * res = bpf_probe_read_user_str(buf, sizeof(buf),
+ * ctx->di);
*
* // Consume buf, for example push it to
* // userspace via bpf_perf_event_output(); we
--
2.37.2
next prev parent reply other threads:[~2022-08-29 20:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 17:56 [PATCH] Fit line in 80 columns Alejandro Colomar
2022-08-25 18:06 ` Alexei Starovoitov
2022-08-25 21:36 ` Andrii Nakryiko
2022-08-25 21:51 ` Alejandro Colomar
2022-08-25 21:54 ` Alejandro Colomar
2022-08-25 22:54 ` G. Branden Robinson
2022-08-26 0:25 ` Alexei Starovoitov
2022-08-26 0:45 ` Seth David Schoen
2022-08-27 7:20 ` Greg KH
2022-08-29 19:58 ` Alejandro Colomar [this message]
2022-08-29 20:29 ` [PATCH v2] Fit lines " Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220829195842.85290-1-alx.manpages@gmail.com \
--to=alx.manpages@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=g.branden.robinson@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=quentin@isovalent.com \
--cc=sdf@google.com \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox