mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Jiri Slaby <jslaby@suse.cz>
Cc: Binoy Jayan <binoy.jayan@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: staging/wilc1000: wrong conversion to completion?
Date: Mon, 11 Jul 2016 10:08:44 +0200	[thread overview]
Message-ID: <2175605.xXp7n8TQsH@wuerfel> (raw)
In-Reply-To: <b1b02b78-041e-469b-702c-d1b5ebef8ec7@suse.cz>

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

  reply	other threads:[~2016-07-11  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11  7:41 Jiri Slaby
2016-07-11  8:08 ` Arnd Bergmann [this message]
2016-07-20  4:36   ` Binoy Jayan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2175605.xXp7n8TQsH@wuerfel \
    --to=arnd@arndb.de \
    --cc=binoy.jayan@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®