Commit 2c30245c authored by Ingo Molnar's avatar Ingo Molnar

llist: Remove the platform-dependent NMI checks

Remove the nmi() checks spread around the code. in_nmi() is not available
on every architecture and it's a pretty obscure and ugly check in any case.

Cc: Huang Ying <ying.huang@intel.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1315461646-1379-3-git-send-email-ying.huang@intel.comSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 1230db8e
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
* *
* The basic atomic operation of this list is cmpxchg on long. On * The basic atomic operation of this list is cmpxchg on long. On
* architectures that don't have NMI-safe cmpxchg implementation, the * architectures that don't have NMI-safe cmpxchg implementation, the
* list can NOT be used in NMI handler. So code uses the list in NMI * list can NOT be used in NMI handlers. So code that uses the list in
* handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. * an NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
* *
* Copyright 2010,2011 Intel Corp. * Copyright 2010,2011 Intel Corp.
* Author: Huang Ying <ying.huang@intel.com> * Author: Huang Ying <ying.huang@intel.com>
...@@ -147,10 +147,6 @@ static inline void llist_add(struct llist_node *new, struct llist_head *head) ...@@ -147,10 +147,6 @@ static inline void llist_add(struct llist_node *new, struct llist_head *head)
{ {
struct llist_node *entry, *old_entry; struct llist_node *entry, *old_entry;
#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
BUG_ON(in_nmi());
#endif
entry = head->first; entry = head->first;
do { do {
old_entry = entry; old_entry = entry;
...@@ -169,10 +165,6 @@ static inline void llist_add(struct llist_node *new, struct llist_head *head) ...@@ -169,10 +165,6 @@ static inline void llist_add(struct llist_node *new, struct llist_head *head)
*/ */
static inline struct llist_node *llist_del_all(struct llist_head *head) static inline struct llist_node *llist_del_all(struct llist_head *head)
{ {
#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
BUG_ON(in_nmi());
#endif
return xchg(&head->first, NULL); return xchg(&head->first, NULL);
} }
#endif /* LLIST_H */ #endif /* LLIST_H */
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* The basic atomic operation of this list is cmpxchg on long. On * The basic atomic operation of this list is cmpxchg on long. On
* architectures that don't have NMI-safe cmpxchg implementation, the * architectures that don't have NMI-safe cmpxchg implementation, the
* list can NOT be used in NMI handler. So code uses the list in NMI * list can NOT be used in NMI handlers. So code that uses the list in
* handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. * an NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
* *
* Copyright 2010,2011 Intel Corp. * Copyright 2010,2011 Intel Corp.
* Author: Huang Ying <ying.huang@intel.com> * Author: Huang Ying <ying.huang@intel.com>
...@@ -40,10 +40,6 @@ void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last, ...@@ -40,10 +40,6 @@ void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
{ {
struct llist_node *entry, *old_entry; struct llist_node *entry, *old_entry;
#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
BUG_ON(in_nmi());
#endif
entry = head->first; entry = head->first;
do { do {
old_entry = entry; old_entry = entry;
...@@ -71,10 +67,6 @@ struct llist_node *llist_del_first(struct llist_head *head) ...@@ -71,10 +67,6 @@ struct llist_node *llist_del_first(struct llist_head *head)
{ {
struct llist_node *entry, *old_entry, *next; struct llist_node *entry, *old_entry, *next;
#ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
BUG_ON(in_nmi());
#endif
entry = head->first; entry = head->first;
do { do {
if (entry == NULL) if (entry == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment