[PATCH] USB:optimize usb_unblock_urb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 66da838935cc4a3aba4275fbea7b5165be04ea12 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver@xxxxxxxxxx>
Date: Fri, 27 Apr 2012 13:04:47 +0200
Subject: [PATCH] USB:optimize usb_unblock_urb

usb_unblock_urb() is identical to usb_unpoison_urb()
Optimize to an implementation with the preprocessor

Signed-off-by: Oliver Neukum <oneukum@xxxxxxx>
---

This addresses Alan's concern.

 drivers/usb/core/urb.c |    9 ---------
 include/linux/usb.h    |    3 ++-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 1d1b010..c6b67c3 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -701,15 +701,6 @@ void usb_block_urb(struct urb *urb)
 }
 EXPORT_SYMBOL_GPL(usb_block_urb);
 
-void usb_unblock_urb(struct urb *urb)
-{
-        if (!urb)
-                return;
-
-        atomic_dec(&urb->reject);
-}
-EXPORT_SYMBOL_GPL(usb_unblock_urb);
-
 /**
  * usb_kill_anchored_urbs - cancel transfer requests en masse
  * @anchor: anchor the requests are bound to
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 23df8ae..26229fd 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1380,7 +1380,6 @@ extern void usb_kill_urb(struct urb *urb);
 extern void usb_poison_urb(struct urb *urb);
 extern void usb_unpoison_urb(struct urb *urb);
 extern void usb_block_urb(struct urb *urb);
-extern void usb_unblock_urb(struct urb *urb);
 extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
 extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
 extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
@@ -1393,6 +1392,8 @@ extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor);
 extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
 extern int usb_anchor_empty(struct usb_anchor *anchor);
 
+#define usb_unblock_urb	usb_unpoison_urb
+
 /**
  * usb_urb_dir_in - check if an URB describes an IN transfer
  * @urb: URB to be checked
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux