lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 29 Jun 2022 10:36:50 -0700
From:   Martin KaFai Lau <kafai@...com>
To:     Jules Irenge <jbi.octave@...il.com>
Cc:     Elana.Copperman@...ileye.com, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>, netdev@...r.kernel.org,
        bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] btf: Fix error of Macros with multiple statements

On Wed, Jun 29, 2022 at 06:19:30PM +0100, Jules Irenge wrote:
> This patch fixes an error reported by checkpatch.pl
No.  It is not a fix.

Have you at least compiler tested it ?

> 
> 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@...il.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ