+#ifdef KERNEL_PRIVATE
+#define CIRCLEQ_CHECK_HEAD(head, field) do { \
+ if (__improbable( \
+ CIRCLEQ_FIRST((head)) != ((void*)(head)) && \
+ CIRCLEQ_FIRST((head))->field.cqe_prev != ((void*)(head))))\
+ panic("Bad circleq head %p first->prev != head", (head)); \
+} while(0)
+#define CIRCLEQ_CHECK_NEXT(head, elm, field) do { \
+ if (__improbable( \
+ CIRCLEQ_NEXT((elm), field) != ((void*)(head)) && \
+ CIRCLEQ_NEXT((elm), field)->field.cqe_prev != (elm))) \
+ panic("Bad circleq elm %p next->prev != elm", (elm)); \
+} while(0)
+#define CIRCLEQ_CHECK_PREV(head, elm, field) do { \
+ if (__improbable( \
+ CIRCLEQ_PREV((elm), field) != ((void*)(head)) && \
+ CIRCLEQ_PREV((elm), field)->field.cqe_next != (elm))) \
+ panic("Bad circleq elm %p prev->next != elm", (elm)); \
+} while(0)
+#else
+#define CIRCLEQ_CHECK_HEAD(head, field)
+#define CIRCLEQ_CHECK_NEXT(head, elm, field)
+#define CIRCLEQ_CHECK_PREV(head, elm, field)
+#endif /* KERNEL_PRIVATE */
+