diff options
| author | Ingo Molnar <mingo@elte.hu> | 2011-10-04 06:43:11 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2011-10-04 06:43:11 -0400 |
| commit | 2c30245c65e8ebc3080b75ce65572ab8140bad0b (patch) | |
| tree | ed13624ac1bb8d9d81449254cdc086fe8eb76f94 | |
| parent | 1230db8e1543c0471dd165727d34647ab098cc1e (diff) | |
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.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | include/linux/llist.h | 12 | ||||
| -rw-r--r-- | lib/llist.c | 12 |
2 files changed, 4 insertions, 20 deletions
diff --git a/include/linux/llist.h b/include/linux/llist.h index 3eccdfd66096..65fca1cbf514 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
| @@ -35,8 +35,8 @@ | |||
| 35 | * | 35 | * |
| 36 | * The basic atomic operation of this list is cmpxchg on long. On | 36 | * The basic atomic operation of this list is cmpxchg on long. On |
| 37 | * architectures that don't have NMI-safe cmpxchg implementation, the | 37 | * architectures that don't have NMI-safe cmpxchg implementation, the |
| 38 | * list can NOT be used in NMI handler. So code uses the list in NMI | 38 | * list can NOT be used in NMI handlers. So code that uses the list in |
| 39 | * handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. | 39 | * an NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. |
| 40 | * | 40 | * |
| 41 | * Copyright 2010,2011 Intel Corp. | 41 | * Copyright 2010,2011 Intel Corp. |
| 42 | * Author: Huang Ying <ying.huang@intel.com> | 42 | * 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 | { | 147 | { |
| 148 | struct llist_node *entry, *old_entry; | 148 | struct llist_node *entry, *old_entry; |
| 149 | 149 | ||
| 150 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
| 151 | BUG_ON(in_nmi()); | ||
| 152 | #endif | ||
| 153 | |||
| 154 | entry = head->first; | 150 | entry = head->first; |
| 155 | do { | 151 | do { |
| 156 | old_entry = entry; | 152 | old_entry = entry; |
| @@ -169,10 +165,6 @@ static inline void llist_add(struct llist_node *new, struct llist_head *head) | |||
| 169 | */ | 165 | */ |
| 170 | static inline struct llist_node *llist_del_all(struct llist_head *head) | 166 | static inline struct llist_node *llist_del_all(struct llist_head *head) |
| 171 | { | 167 | { |
| 172 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
| 173 | BUG_ON(in_nmi()); | ||
| 174 | #endif | ||
| 175 | |||
| 176 | return xchg(&head->first, NULL); | 168 | return xchg(&head->first, NULL); |
| 177 | } | 169 | } |
| 178 | #endif /* LLIST_H */ | 170 | #endif /* LLIST_H */ |
diff --git a/lib/llist.c b/lib/llist.c index 3e3fa9139c41..b445f2c8596a 100644 --- a/lib/llist.c +++ b/lib/llist.c | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | * | 3 | * |
| 4 | * The basic atomic operation of this list is cmpxchg on long. On | 4 | * The basic atomic operation of this list is cmpxchg on long. On |
| 5 | * architectures that don't have NMI-safe cmpxchg implementation, the | 5 | * architectures that don't have NMI-safe cmpxchg implementation, the |
| 6 | * list can NOT be used in NMI handler. So code uses the list in NMI | 6 | * list can NOT be used in NMI handlers. So code that uses the list in |
| 7 | * handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. | 7 | * an NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. |
| 8 | * | 8 | * |
| 9 | * Copyright 2010,2011 Intel Corp. | 9 | * Copyright 2010,2011 Intel Corp. |
| 10 | * Author: Huang Ying <ying.huang@intel.com> | 10 | * 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 | { | 40 | { |
| 41 | struct llist_node *entry, *old_entry; | 41 | struct llist_node *entry, *old_entry; |
| 42 | 42 | ||
| 43 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
| 44 | BUG_ON(in_nmi()); | ||
| 45 | #endif | ||
| 46 | |||
| 47 | entry = head->first; | 43 | entry = head->first; |
| 48 | do { | 44 | do { |
| 49 | old_entry = entry; | 45 | old_entry = entry; |
| @@ -71,10 +67,6 @@ struct llist_node *llist_del_first(struct llist_head *head) | |||
| 71 | { | 67 | { |
| 72 | struct llist_node *entry, *old_entry, *next; | 68 | struct llist_node *entry, *old_entry, *next; |
| 73 | 69 | ||
| 74 | #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG | ||
| 75 | BUG_ON(in_nmi()); | ||
| 76 | #endif | ||
| 77 | |||
| 78 | entry = head->first; | 70 | entry = head->first; |
| 79 | do { | 71 | do { |
| 80 | if (entry == NULL) | 72 | if (entry == NULL) |
