Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1440338

Re: staging/wilc1000: wrong conversion to completion?

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: staging/wilc1000: wrong conversion to completion?
Date 2016-07-11 10:10 +0200
Message-ID <rTErT-4nS-7@gated-at.bofh.it> (permalink)
References <rTE8x-42b-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Monday, July 11, 2016 9:41:15 AM CEST Jiri Slaby wrote:
> Hi,
> 
> while looking at this commit:
> 
> commit b27a6d5e636ac80b223a18ca2b3c892f1caef9e3
> Author: Binoy Jayan <binoy.jayan@linaro.org>
> Date:   Wed Jun 15 11:00:34 2016 +0530
> 
>     staging: wilc1000: Replace semaphore txq_event with completion
> 
>     The semaphore 'txq_event' is used as completion, so convert it
>     to a struct completion type.
> 
>     Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
>     Reviewed-by: Arnd Bergmann <arnd@arndb.de>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> diff --git a/drivers/staging/wilc1000/linux_wlan.c
> b/drivers/staging/wilc1000/linux_wlan.c
> index 274c390d17cd..baf932681362 100644
> --- a/drivers/staging/wilc1000/linux_wlan.c
> +++ b/drivers/staging/wilc1000/linux_wlan.c
> @@ -316,7 +316,7 @@ static int linux_wlan_txq_task(void *vp)
> 
>         complete(&wl->txq_thread_started);
>         while (1) {
> -               down(&wl->txq_event);
> +               wait_for_completion(&wl->txq_event);
> 
>                 if (wl->close) {
>                         complete(&wl->txq_thread_started);
> @@ -650,7 +650,7 @@ void wilc1000_wlan_deinit(struct net_device *dev)
>                         mutex_unlock(&wl->hif_cs);
>                 }
>                 if (&wl->txq_event)
> -                       up(&wl->txq_event);
> +                       wait_for_completion(&wl->txq_event);
> 
> 
> I wonder: is this correct? Should that be complete() instead?
> 

Yes, I agree, sorry for missing that in my review.

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

staging/wilc1000: wrong conversion to completion? Jiri Slaby <jslaby@suse.cz> - 2016-07-11 09:50 +0200
  Re: staging/wilc1000: wrong conversion to completion? Arnd Bergmann <arnd@arndb.de> - 2016-07-11 10:10 +0200
    Re: staging/wilc1000: wrong conversion to completion? Binoy Jayan <binoy.jayan@linaro.org> - 2016-07-20 06:40 +0200

csiph-web