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/vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/zfs/vdev.c') diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 30f0515cf..7dc00650c 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -2197,7 +2197,7 @@ void vdev_close(vdev_t *vd) { vdev_t *pvd = vd->vdev_parent; - ASSERTV(spa_t *spa = vd->vdev_spa); + spa_t *spa __maybe_unused = vd->vdev_spa; ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); -- cgit v1.2.3