From: Jules Irenge <jbi.octave@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: Elana.Copperman@mobileye.com, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] btf: Fix error of Macros with multiple statements
Date: Wed, 29 Jun 2022 18:19:30 +0100 [thread overview]
Message-ID: <YryJosfh8z2DhKC0@playground> (raw)
This patch fixes an error reported by checkpatch.pl
ERROR: Macros with multiple statements should be
enclosed in a do while loop
To fix this a do while(0) loop is used
to encloses the multiple statements.
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
kernel/bpf/btf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 1bc496162572..95c1ee525e28 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -5057,8 +5057,10 @@ extern struct btf *btf_vmlinux;
static union {
struct bpf_ctx_convert {
#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \
- prog_ctx_type _id##_prog; \
- kern_ctx_type _id##_kern;
+ do { \
+ prog_ctx_type _id##_prog; \
+ kern_ctx_type _id##_kern; \
+ } while (0)
#include <linux/bpf_types.h>
#undef BPF_PROG_TYPE
} *__t;
--
2.36.1
next reply other threads:[~2022-06-29 17:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 17:19 Jules Irenge [this message]
2022-06-29 17:36 ` [PATCH 2/2] btf: Fix error of Macros with multiple statements Martin KaFai Lau
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=YryJosfh8z2DhKC0@playground \
--to=jbi.octave@gmail.com \
--cc=Elana.Copperman@mobileye.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.