From 2a8ba608d3eace43010174aa4f67c8b8af4aacf3 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Thu, 5 Dec 2019 12:37:00 -0800 Subject: 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 Reviewed-by: Jorgen Lundman Signed-off-by: Matt Macy Closes #9671 --- module/zfs/dnode_sync.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/zfs/dnode_sync.c') diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c index 4e002d326..5df395a6f 100644 --- a/module/zfs/dnode_sync.c +++ b/module/zfs/dnode_sync.c @@ -422,11 +422,11 @@ dnode_sync_free_range_impl(dnode_t *dn, uint64_t blkid, uint64_t nblks, * match. */ if (trunc && !dn->dn_objset->os_raw_receive) { - ASSERTV(uint64_t off); + uint64_t off __maybe_unused; dn->dn_phys->dn_maxblkid = blkid == 0 ? 0 : blkid - 1; - ASSERTV(off = (dn->dn_phys->dn_maxblkid + 1) * - (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT)); + off = (dn->dn_phys->dn_maxblkid + 1) * + (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT); ASSERT(off < dn->dn_phys->dn_maxblkid || dn->dn_phys->dn_maxblkid == 0 || dnode_next_offset(dn, 0, &off, 1, 1, 0) != 0); @@ -628,7 +628,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dnode_phys_t *dnp = dn->dn_phys; int txgoff = tx->tx_txg & TXG_MASK; list_t *list = &dn->dn_dirty_records[txgoff]; - ASSERTV(static const dnode_phys_t zerodn = { 0 }); + static const dnode_phys_t zerodn __maybe_unused = { 0 }; boolean_t kill_spill = B_FALSE; ASSERT(dmu_tx_is_syncing(tx)); -- cgit v1.2.3