Finally get it hopefully right.
KASSERT(pthread_rwlock_unlock(&SCTP_BASE_INFO(ipi_ep_mtx)) == 0, ("%s: ipi_ep_mtx not locked", __func__))
#define SCTP_INP_INFO_WUNLOCK() \
KASSERT(pthread_rwlock_unlock(&SCTP_BASE_INFO(ipi_ep_mtx)) == 0, ("%s: ipi_ep_mtx not locked", __func__))
-#define SCTP_INP_INFO_WLOCK_ASSERT() do { \
- int _retval = pthread_rwlock_trywrlock(&SCTP_BASE_INFO(ipi_ep_mtx)); \
- KASSERT(_retval == EDEADLK || _retval == EBUSY, ("%s: ipi_ep_mtx not locked", __func__)); \
-} while (0)
+#define SCTP_INP_INFO_WLOCK_ASSERT() \
+ KASSERT(pthread_rwlock_trywrlock(&SCTP_BASE_INFO(ipi_ep_mtx)) == EDEADLK, ("%s: ipi_ep_mtx not locked", __func__))
#else
#define SCTP_INP_INFO_RLOCK() \
(void)pthread_rwlock_rdlock(&SCTP_BASE_INFO(ipi_ep_mtx))
#define SCTP_IPI_ADDR_WUNLOCK() \
KASSERT(pthread_rwlock_unlock(&SCTP_BASE_INFO(ipi_addr_mtx)) == 0, ("%s: ipi_addr_mtx not locked", __func__))
#define SCTP_IPI_ADDR_LOCK_ASSERT()
-#define SCTP_IPI_ADDR_WLOCK_ASSERT() do { \
- int _retval = pthread_rwlock_trywrlock(&SCTP_BASE_INFO(ipi_addr_mtx)); \
- KASSERT(_retval == EDEADLK || _retval == EBUSY, ("%s: ipi_ep_mtx not locked", __func__)); \
-} while (0)
+#define SCTP_IPI_ADDR_WLOCK_ASSERT() \
+ KASSERT(pthread_rwlock_trywrlock(&SCTP_BASE_INFO(ipi_addr_mtx)) == EDEADLK, ("%s: ipi_ep_mtx not locked", __func__))
#else
#define SCTP_IPI_ADDR_RLOCK() \
(void)pthread_rwlock_rdlock(&SCTP_BASE_INFO(ipi_addr_mtx))
