Re: [patch V2 03/15] usb: gadget: Use completion interface instead of open coding it

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2020-03-19 08:41:19
Also in
linux-pci, linux-usb, linuxppc-dev, lkml, netdev
Reply to
Thomas Gleixner, 2020-03-18
On Wed, Mar 18, 2020 at 09:43:05PM +0100, Thomas Gleixner wrote:
ep_io() uses a completion on stack and open codes the waiting with:

  wait_event_interruptible (done.wait, done.done);
and
  wait_event (done.wait, done.done);

This waits in non-exclusive mode for complete(), but there is no reason to
do so because the completion can only be waited for by the task itself and
complete() wakes exactly one exlusive waiter.

Replace the open coded implementation with the corresponding
wait_for_completion*() functions.

No functional change.

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <redacted>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <redacted>
---
V2: New patch to avoid the conversion to swait interfaces later
---
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thread (72 messages) 72 messages, 17 authors, last reply 2020-03-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help