#define LLIST_HEAD_INIT(name) { NULL }
#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
+#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
+#define CHECK_NMI_SAFE_CMPXCHG()
+#else
+#define CHECK_NMI_SAFE_CMPXCHG() BUG_ON(in_nmi())
+#endif
+
/**
* init_llist_head - initialize lock-less list head
* @head: the head for your lock-less list
{
struct llist_node *entry, *old_entry;
-#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
- BUG_ON(in_nmi());
-#endif
+ CHECK_NMI_SAFE_CMPXCHG();
entry = head->first;
do {
{
struct llist_node *entry, *old_entry;
-#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
- BUG_ON(in_nmi());
-#endif
+ CHECK_NMI_SAFE_CMPXCHG();
entry = head->first;
do {
{
struct llist_node *entry, *old_entry, *next;
-#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
- BUG_ON(in_nmi());
-#endif
+ CHECK_NMI_SAFE_CMPXCHG();
entry = head->first;
do {
*/
static inline struct llist_node *llist_del_all(struct llist_head *head)
{
-#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
- BUG_ON(in_nmi());
-#endif
+ CHECK_NMI_SAFE_CMPXCHG();
return xchg(&head->first, NULL);
}