From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [UPDATE PATCH 36/39] usb/kaweth: use wait_event_timeout()
Date: Mon, 31 Jan 2005 19:40:22 +0000 [thread overview]
Message-ID: <20050131194022.GF2683@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2721 bytes --]
On Mon, Jan 31, 2005 at 11:33:28AM -0800, Greg KH wrote:
> On Mon, Jan 31, 2005 at 11:27:03AM -0800, Nishanth Aravamudan wrote:
> > On Mon, Jan 31, 2005 at 10:51:59AM -0800, Greg KH wrote:
> > > On Fri, Jan 21, 2005 at 01:36:35PM -0800, Nishanth Aravamudan wrote:
> > > > Hi,
> > > >
> > > > Please consider applying.
> > > >
> > > > Description: Use wait_event_timeout() instead of custom wait-queue code. Remove
> > > > now unused variables. I changed the code to only add to the wait-queue if
> > > > necessary, but I'm not sure if this is correct.
> > >
> > > Please at least compile your patches to make sure they build. This one
> > > does not :(
> >
> > I'm not seeing a build error here; what errors are coming up for you?
>
> Don't remember anymore, as I reverted the patch already...
>
> I think it was a {} matching issue like your other patches.
You are right. I had actually fixed this, but didn't mail the updated diff.
Sorry about that, Greg.
Please consider the following which builds cleanly.
Description: Use wait_event_timeout() instead of custom wait-queue code. Remove
now unused variables. I changed the code to only add to the wait-queue if
necessary, but I'm not sure if this is correct.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.11-rc2-v/drivers/usb/net/kaweth.c 2005-01-31 11:17:54.000000000 -0800
+++ 2.6.11-rc2-kj/drivers/usb/net/kaweth.c 2005-01-24 09:35:07.000000000 -0800
@@ -58,6 +58,7 @@
#include <linux/ethtool.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
+#include <linux/wait.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
#include <asm/byteorder.h>
@@ -1180,31 +1181,21 @@ static void usb_api_blocking_completion(
// Starts urb and waits for completion or timeout
static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
{
- DECLARE_WAITQUEUE(wait, current);
struct usb_api_data awd;
int status;
init_waitqueue_head(&awd.wqh);
awd.done = 0;
- add_wait_queue(&awd.wqh, &wait);
urb->context = &awd;
status = usb_submit_urb(urb, GFP_NOIO);
if (status) {
// something went wrong
usb_free_urb(urb);
- remove_wait_queue(&awd.wqh, &wait);
return status;
}
- while (timeout && !awd.done) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- timeout = schedule_timeout(timeout);
- }
-
- remove_wait_queue(&awd.wqh, &wait);
-
- if (!timeout) {
+ if (!wait_event_timeout(awd.wqh, awd.done, timeout)) {
// timeout
kaweth_warn("usb_control/bulk_msg: timeout");
usb_kill_urb(urb); // remove urb safely
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
reply other threads:[~2005-01-31 19:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050131194022.GF2683@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=kernel-janitors@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 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.