Skip to contentSkip to conversation

usb: gadget: f_fs: use complete() instead complete_all()

PATCH In review Daniel Wagner 2 participants 2 messages Sep 22, 2016 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: f_fs: use complete() instead complete_all()

From: Daniel Wagner <[email protected]>

There is only one waiter for the completion, therefore there is no need to use complete_all(). Let's make that clear by using complete() instead of complete_all().

The usage pattern of the completion is:

waiter context waker context
reinit_completion()
usb_esp_queue()
wait_for_completion_interruptible()

					ffs_ep0_complete()
					  complete()
Cc Felipe Balbi <[email protected]>
Cc Michal Nazarewicz <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/gadget/function/f_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/f_fs.c +1 -1
index 5c8429f..0c29039 100644
@@ -211,7 +211,7 @@ static void ffs_ep0_complete(struct usb_ep *ep, struct usb_request *req)
 {
 	struct ffs_data *ffs = req->context;
 
-	complete_all(&ffs->ep0req_completion);
+	complete(&ffs->ep0req_completion);
 }
 
 static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Daniel Wagner

From: Daniel Wagner <[email protected]>

There is only one waiter for the completion, therefore there is no need to use complete_all(). Let's make that clear by using complete() instead of complete_all().

The usage pattern of the completion is:

waiter context waker context
reinit_completion()
usb_esp_queue()
wait_for_completion_interruptible()

Quoted 6 lines
					ffs_ep0_complete()
					  complete()
Cc Felipe Balbi <[email protected]>
Cc Michal Nazarewicz <[email protected]>
Quoted 21 lines
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/gadget/function/f_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/f_fs.c +1 -1
index 5c8429f..0c29039 100644
@@ -211,7 +211,7 @@ static void ffs_ep0_complete(struct usb_ep *ep, struct usb_request *req)
 {
 	struct ffs_data *ffs = req->context;
 
-	complete_all(&ffs->ep0req_completion);
+	complete(&ffs->ep0req_completion);
 }
 
 static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len)
Signature · 1 line
2.7.4
Signature · 3 lines
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»