Commit 704500ef authored by Duncan Sands's avatar Duncan Sands Committed by Linus Torvalds

[PATCH] USB speedtouch: spin_lock_irqsave -> spin_lock_irq in process context

Replace spin_lock_irqsave/spin_unlock_irqrestore with
spin_lock_irq/spin_unlock_irq in routines that are only
called in process context.
parent 916613e7
...@@ -621,15 +621,14 @@ static void udsl_process_receive (unsigned long data) ...@@ -621,15 +621,14 @@ static void udsl_process_receive (unsigned long data)
static void udsl_fire_receivers (struct udsl_instance_data *instance) static void udsl_fire_receivers (struct udsl_instance_data *instance)
{ {
struct list_head receivers, *pos, *n; struct list_head receivers, *pos, *n;
unsigned long flags;
INIT_LIST_HEAD (&receivers); INIT_LIST_HEAD (&receivers);
down (&instance->serialize); down (&instance->serialize);
spin_lock_irqsave (&instance->spare_receivers_lock, flags); spin_lock_irq (&instance->spare_receivers_lock);
list_splice_init (&instance->spare_receivers, &receivers); list_splice_init (&instance->spare_receivers, &receivers);
spin_unlock_irqrestore (&instance->spare_receivers_lock, flags); spin_unlock_irq (&instance->spare_receivers_lock);
list_for_each_safe (pos, n, &receivers) { list_for_each_safe (pos, n, &receivers) {
struct udsl_receiver *rcv = list_entry (pos, struct udsl_receiver, list); struct udsl_receiver *rcv = list_entry (pos, struct udsl_receiver, list);
...@@ -646,9 +645,9 @@ static void udsl_fire_receivers (struct udsl_instance_data *instance) ...@@ -646,9 +645,9 @@ static void udsl_fire_receivers (struct udsl_instance_data *instance)
if (usb_submit_urb (rcv->urb, GFP_KERNEL) < 0) { if (usb_submit_urb (rcv->urb, GFP_KERNEL) < 0) {
dbg ("udsl_fire_receivers: submit failed!"); dbg ("udsl_fire_receivers: submit failed!");
spin_lock_irqsave (&instance->spare_receivers_lock, flags); spin_lock_irq (&instance->spare_receivers_lock);
list_move (pos, &instance->spare_receivers); list_move (pos, &instance->spare_receivers);
spin_unlock_irqrestore (&instance->spare_receivers_lock, flags); spin_unlock_irq (&instance->spare_receivers_lock);
} }
} }
...@@ -790,11 +789,10 @@ static void udsl_process_send (unsigned long data) ...@@ -790,11 +789,10 @@ static void udsl_process_send (unsigned long data)
static void udsl_cancel_send (struct udsl_instance_data *instance, struct atm_vcc *vcc) static void udsl_cancel_send (struct udsl_instance_data *instance, struct atm_vcc *vcc)
{ {
unsigned long flags;
struct sk_buff *skb, *n; struct sk_buff *skb, *n;
dbg ("udsl_cancel_send entered"); dbg ("udsl_cancel_send entered");
spin_lock_irqsave (&instance->sndqueue.lock, flags); spin_lock_irq (&instance->sndqueue.lock);
for (skb = instance->sndqueue.next, n = skb->next; skb != (struct sk_buff *)&instance->sndqueue; skb = n, n = skb->next) for (skb = instance->sndqueue.next, n = skb->next; skb != (struct sk_buff *)&instance->sndqueue; skb = n, n = skb->next)
if (UDSL_SKB (skb)->atm_data.vcc == vcc) { if (UDSL_SKB (skb)->atm_data.vcc == vcc) {
dbg ("popping skb 0x%p", skb); dbg ("popping skb 0x%p", skb);
...@@ -804,7 +802,7 @@ static void udsl_cancel_send (struct udsl_instance_data *instance, struct atm_vc ...@@ -804,7 +802,7 @@ static void udsl_cancel_send (struct udsl_instance_data *instance, struct atm_vc
else else
kfree_skb (skb); kfree_skb (skb);
} }
spin_unlock_irqrestore (&instance->sndqueue.lock, flags); spin_unlock_irq (&instance->sndqueue.lock);
tasklet_disable (&instance->send_tasklet); tasklet_disable (&instance->send_tasklet);
if ((skb = instance->current_skb) && (UDSL_SKB (skb)->atm_data.vcc == vcc)) { if ((skb = instance->current_skb) && (UDSL_SKB (skb)->atm_data.vcc == vcc)) {
...@@ -1257,7 +1255,6 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1257,7 +1255,6 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
{ {
struct udsl_instance_data *instance = usb_get_intfdata (intf); struct udsl_instance_data *instance = usb_get_intfdata (intf);
struct list_head *pos; struct list_head *pos;
unsigned long flags;
unsigned int count = 0; unsigned int count = 0;
int result, i; int result, i;
...@@ -1293,11 +1290,11 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1293,11 +1290,11 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
do { do {
unsigned int completed = 0; unsigned int completed = 0;
spin_lock_irqsave (&instance->completed_receivers_lock, flags); spin_lock_irq (&instance->completed_receivers_lock);
list_for_each (pos, &instance->completed_receivers) list_for_each (pos, &instance->completed_receivers)
if (++completed > count) if (++completed > count)
panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__); panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__);
spin_unlock_irqrestore (&instance->completed_receivers_lock, flags); spin_unlock_irq (&instance->completed_receivers_lock);
dbg ("udsl_usb_disconnect: found %u completed receivers", completed); dbg ("udsl_usb_disconnect: found %u completed receivers", completed);
...@@ -1333,11 +1330,11 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1333,11 +1330,11 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
/* wait for completion handlers to finish */ /* wait for completion handlers to finish */
do { do {
count = 0; count = 0;
spin_lock_irqsave (&instance->send_lock, flags); spin_lock (&instance->send_lock);
list_for_each (pos, &instance->spare_senders) list_for_each (pos, &instance->spare_senders)
if (++count > UDSL_NUMBER_SND_URBS) if (++count > UDSL_NUMBER_SND_URBS)
panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__); panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__);
spin_unlock_irqrestore (&instance->send_lock, flags); spin_unlock (&instance->send_lock);
dbg ("udsl_usb_disconnect: found %u spare senders", count); dbg ("udsl_usb_disconnect: found %u spare senders", count);
......
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