From 7a35f2b49581894cde93c356fd9372ff3246d344 Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Mon, 19 Jun 2017 11:02:20 -0700 Subject: [PATCH] Fix RWSEM_SPINLOCK_IS_RAW check failed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Initialize dummy_lock to fix the build error in gcc 7.1.1 with: error: ‘dummy_lock’ is used uninitialized in this function Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Chunwei Chen Closes #622 --- config/spl-build.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 7569988..698d51a 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -1313,7 +1313,8 @@ AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [ #include ],[ struct rw_semaphore dummy_semaphore __attribute__ ((unused)); - raw_spinlock_t dummy_lock __attribute__ ((unused)); + raw_spinlock_t dummy_lock __attribute__ ((unused)) = + __RAW_SPIN_LOCK_INITIALIZER(dummy_lock); dummy_semaphore.wait_lock = dummy_lock; ],[ AC_MSG_RESULT(yes) -- 2.39.2