git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: device subsystem rework
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
ds
/
hashtable.h
diff --git
a/lunaix-os/includes/lunaix/ds/hashtable.h
b/lunaix-os/includes/lunaix/ds/hashtable.h
index c3aea3f451dd973d19802009307aafa92e812e1f..41ca36b511d966fa591504525b2de6bfbd88b91b 100644
(file)
--- a/
lunaix-os/includes/lunaix/ds/hashtable.h
+++ b/
lunaix-os/includes/lunaix/ds/hashtable.h
@@
-21,9
+21,9
@@
struct hbucket
struct hlist_node* head;
};
struct hlist_node* head;
};
-#define __hashkey(table, hash) (
hash
% (sizeof(table) / sizeof(table[0])))
+#define __hashkey(table, hash) (
(hash)
% (sizeof(table) / sizeof(table[0])))
-#define DECLARE_HASHTABLE(name, bucket_num) struct hbucket name[
bucket_num
];
+#define DECLARE_HASHTABLE(name, bucket_num) struct hbucket name[
(bucket_num)
];
#define hashtable_bucket_foreach(bucket, pos, n, member) \
for (pos = list_entry((bucket)->head, typeof(*pos), member); \
#define hashtable_bucket_foreach(bucket, pos, n, member) \
for (pos = list_entry((bucket)->head, typeof(*pos), member); \