From: "harvey.yang" <harvey.huawei.yang@gmail.com>
To: Matt Mooney <mfm@muteddisk.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, harvey.huawei.yang@gmail.com
Subject: [PATCH V2 1/1] staging: usbip: remove an unnecessary lock in usbip_event_happened.
Date: Mon, 5 Nov 2012 17:51:11 +0800 [thread overview]
Message-ID: <1352109071-10696-1-git-send-email-harvey.huawei.yang@gmail.com> (raw)
In-Reply-To: <y>
From: Harvey.Yang <harvey.huawei.yang@gmail.com>
Signed-off-by: Harvey.Yang <harvey.huawei.yang@gmail.com>
---
drivers/staging/usbip/usbip_common.h | 2 +-
drivers/staging/usbip/usbip_event.c | 11 ++---------
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h
index 5d89c0f..b6d7add 100644
--- a/drivers/staging/usbip/usbip_common.h
+++ b/drivers/staging/usbip/usbip_common.h
@@ -330,7 +330,7 @@ int usbip_recv_xbuff(struct usbip_device *ud, struct urb *urb);
int usbip_start_eh(struct usbip_device *ud);
void usbip_stop_eh(struct usbip_device *ud);
void usbip_event_add(struct usbip_device *ud, unsigned long event);
-int usbip_event_happened(struct usbip_device *ud);
+inline int usbip_event_happened(struct usbip_device *ud);
static inline int interface_to_busnum(struct usb_interface *interface)
{
diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
index d332a34..15871f0 100644
--- a/drivers/staging/usbip/usbip_event.c
+++ b/drivers/staging/usbip/usbip_event.c
@@ -112,15 +112,8 @@ void usbip_event_add(struct usbip_device *ud, unsigned long event)
}
EXPORT_SYMBOL_GPL(usbip_event_add);
-int usbip_event_happened(struct usbip_device *ud)
+inline 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;
+ return ud->event ? 1 : 0;
}
EXPORT_SYMBOL_GPL(usbip_event_happened);
--
1.7.1
next reply other threads:[~2012-11-05 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-05 9:51 harvey.yang [this message]
2012-11-05 10:04 ` Greg Kroah-Hartman
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=1352109071-10696-1-git-send-email-harvey.huawei.yang@gmail.com \
--to=harvey.huawei.yang@gmail.com \
--cc=gregkh@linuxfoundation.org \
--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 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®