aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2008-09-22 22:21:51 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-22 22:21:51 -0400
commitca330c5a913a9b1690c709f4cfcd6be0c8696b14 (patch)
tree372e4320da2dea602dc9c26ff2411cd82260fedb
parentd48abfecea8513cfd2fd7e341439c1b8a28e9ff4 (diff)
hci_usb: replace mb with smp_mb
smp_mb is enough for ordering memory operations among processors,and mb is more expensive than smp_mb for UP machine, so replace it with smp_mb(). Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/bluetooth/hci_usb.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h
index 1790cc8e431e..8e659914523f 100644
--- a/drivers/bluetooth/hci_usb.h
+++ b/drivers/bluetooth/hci_usb.h
@@ -70,8 +70,8 @@ static inline void _urb_queue_head(struct _urb_queue *q, struct _urb *_urb)
70{ 70{
71 unsigned long flags; 71 unsigned long flags;
72 spin_lock_irqsave(&q->lock, flags); 72 spin_lock_irqsave(&q->lock, flags);
73 /* _urb_unlink needs to know which spinlock to use, thus mb(). */ 73 /* _urb_unlink needs to know which spinlock to use, thus smp_mb(). */
74 _urb->queue = q; mb(); list_add(&_urb->list, &q->head); 74 _urb->queue = q; smp_mb(); list_add(&_urb->list, &q->head);
75 spin_unlock_irqrestore(&q->lock, flags); 75 spin_unlock_irqrestore(&q->lock, flags);
76} 76}
77 77
@@ -79,8 +79,8 @@ static inline void _urb_queue_tail(struct _urb_queue *q, struct _urb *_urb)
79{ 79{
80 unsigned long flags; 80 unsigned long flags;
81 spin_lock_irqsave(&q->lock, flags); 81 spin_lock_irqsave(&q->lock, flags);
82 /* _urb_unlink needs to know which spinlock to use, thus mb(). */ 82 /* _urb_unlink needs to know which spinlock to use, thus smp_mb(). */
83 _urb->queue = q; mb(); list_add_tail(&_urb->list, &q->head); 83 _urb->queue = q; smp_mb(); list_add_tail(&_urb->list, &q->head);
84 spin_unlock_irqrestore(&q->lock, flags); 84 spin_unlock_irqrestore(&q->lock, flags);
85} 85}
86 86
@@ -89,7 +89,7 @@ static inline void _urb_unlink(struct _urb *_urb)
89 struct _urb_queue *q; 89 struct _urb_queue *q;
90 unsigned long flags; 90 unsigned long flags;
91 91
92 mb(); 92 smp_mb();
93 q = _urb->queue; 93 q = _urb->queue;
94 /* If q is NULL, it will die at easy-to-debug NULL pointer dereference. 94 /* If q is NULL, it will die at easy-to-debug NULL pointer dereference.
95 No need to BUG(). */ 95 No need to BUG(). */