From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Harvey Yang <harvey.huawei.yang@gmail.com>
Cc: Matt Mooney <mfm@muteddisk.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] staging: usbip: remove an unnecessary lock in usbip_event_happened. The variable "happened" is local. So I think there is no need to lock here.
Date: Sun, 4 Nov 2012 20:57:35 -0800 [thread overview]
Message-ID: <20121105045735.GA912@kroah.com> (raw)
In-Reply-To: <1352091026-5441-1-git-send-email-huawei.yang@gmail.com>
On Mon, Nov 05, 2012 at 12:50:26PM +0800, Harvey Yang wrote:
> From: harvey.yang <harvey.huawei.yang@gmail.com>
>
>
> Signed-off-by: harvey.yang <harvey.huawei.yang@gmail.com>
> ---
> drivers/staging/usbip/usbip_event.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
> index d332a34..668f8e0 100644
> --- a/drivers/staging/usbip/usbip_event.c
> +++ b/drivers/staging/usbip/usbip_event.c
> @@ -116,10 +116,8 @@ int usbip_event_happened(struct usbip_device *ud)
> {
> int happened = 0;
>
> - spin_lock(&ud->lock);
> if (ud->event != 0)
> happened = 1;
> - spin_unlock(&ud->lock);
>
> return happened;
Are you sure that the real fix for this isn't just making 'happened' a
static variable? That would make more sense here. Well maybe, the code
seems pretty dumb, it's hard to tell what this is supposed to be doing,
any ideas?
thanks,
greg k-h
next prev parent reply other threads:[~2012-11-05 4:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-05 4:50 [PATCH 1/1] staging: usbip: remove an unnecessary lock in usbip_event_happened. The variable "happened" is local. So I think there is no need to lock here Harvey Yang
2012-11-05 4:57 ` Greg Kroah-Hartman [this message]
2012-11-05 5:34 ` Prashant Shah
2012-11-05 6:34 ` harvey yang
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=20121105045735.GA912@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=harvey.huawei.yang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mfm@muteddisk.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.