Skip to content

Commit

Permalink
Fix RWSEM_SPINLOCK_IS_RAW check failed
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#622
  • Loading branch information
Chunwei Chen authored and behlendorf committed Jun 28, 2017
1 parent ac48361 commit 7a35f2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/spl-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7a35f2b

Please sign in to comment.