lkml.org 
[lkml]   [2023]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] libbpf: fix some typo of hashmap init
Date
rename macro parameters to prevent replacing struct members of hashmap

Signed-off-by: John Sanpe <sanpeqf@gmail.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,
--
2.40.1
\
 
 \ /
  Last update: 2023-07-04 10:56    [W:0.028 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site