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]
Message-ID: <2af93aa0-a81d-d783-b946-dc7ffc875f4c@iogearbox.net>
Date:   Tue, 4 Jul 2023 11:26:04 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     John Sanpe <sanpeqf@...il.com>, ast@...nel.org, andrii@...nel.org
Cc:     martin.lau@...ux.dev, song@...nel.org, yhs@...com,
        john.fastabend@...il.com, kpsingh@...nel.org, sdf@...gle.com,
        haoluo@...gle.com, jolsa@...nel.org, bpf@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] libbpf: fix some typo of hashmap init

On 7/4/23 10:54 AM, John Sanpe wrote:
> rename macro parameters to prevent replacing struct members of hashmap
> 
> Signed-off-by: John Sanpe <sanpeqf@...il.com>
> ---
>   tools/lib/bpf/hashmap.h | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
> index 0a5bf1937a7c..bae3feaf29d0 100644
> --- a/tools/lib/bpf/hashmap.h
> +++ b/tools/lib/bpf/hashmap.h
> @@ -80,14 +80,14 @@ struct hashmap {
>   	size_t sz;
>   };
>   
> -#define HASHMAP_INIT(hash_fn, equal_fn, ctx) {	\
> -	.hash_fn = (hash_fn),			\
> -	.equal_fn = (equal_fn),			\
> -	.ctx = (ctx),				\
> -	.buckets = NULL,			\
> -	.cap = 0,				\
> -	.cap_bits = 0,				\
> -	.sz = 0,				\
> +#define HASHMAP_INIT(_hash_fn, _equal_fn, _ctx) {	\
> +	.hash_fn = (_hash_fn),				\
> +	.equal_fn = (_equal_fn),			\
> +	.ctx = (_ctx),					\
> +	.buckets = NULL,				\
> +	.cap = 0,					\
> +	.cap_bits = 0,					\
> +	.sz = 0,					\
>   }
>   
>   void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn,
> 

Please send a v2 and just remove the whole HASHMAP_INIT. It's not used
anywhere in libbpf.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ