Fix RWSEM_SPINLOCK_IS_RAW check failed

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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #622
This commit is contained in:
Chunwei Chen 2017-06-19 11:02:20 -07:00 committed by Brian Behlendorf
parent ac48361c0c
commit 7a35f2b495
1 changed files with 2 additions and 1 deletions

View File

@ -1313,7 +1313,8 @@ AC_DEFUN([SPL_AC_RWSEM_SPINLOCK_IS_RAW], [
#include <linux/rwsem.h>
],[
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)