mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Replace ASSERTV macro with compiler annotation
Remove the ASSERTV macro and handle suppressing unused compiler warnings for variables only in ASSERTs using the __attribute__((unused)) compiler annotation. The annotation is understood by both gcc and clang. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9671
This commit is contained in:
committed by
Brian Behlendorf
parent
12395c7b0b
commit
2a8ba608d3
+2
-2
@@ -684,8 +684,8 @@ zfs_btree_insert_leaf_impl(zfs_btree_t *tree, zfs_btree_leaf_t *leaf,
|
||||
uint64_t size = tree->bt_elem_size;
|
||||
uint8_t *start = leaf->btl_elems + (idx * size);
|
||||
zfs_btree_hdr_t *hdr = &leaf->btl_hdr;
|
||||
ASSERTV(uint64_t capacity = P2ALIGN((BTREE_LEAF_SIZE -
|
||||
sizeof (zfs_btree_hdr_t)) / size, 2));
|
||||
uint64_t capacity __maybe_unused = P2ALIGN((BTREE_LEAF_SIZE -
|
||||
sizeof (zfs_btree_hdr_t)) / size, 2);
|
||||
uint64_t count = leaf->btl_hdr.bth_count - idx;
|
||||
ASSERT3U(leaf->btl_hdr.bth_count, <, capacity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user