netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: jgarzik@pobox.com
Cc: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org
Subject: [KJ] [PATCH 3/20] net/8139too: remove interruptible_sleep_on_timeout() usage
Date: Wed, 2 Feb 2005 10:11:29 -0800	[thread overview]
Message-ID: <20050202181129.GD2546@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]

Hello,

Please consider applying.


One thing I would have preferred using here is use wait_event*(), but there is
no condition. However, try_to_freeze(PF_FREEZE) could be used as one, if the
return condition matters -- it can return 0 or 1, from what I understand. If the
intent is to loop until the task is "frozen," then I can revise the patch to use
wait_event_interruptible_timeout().

Description: Replace deprecated interruptible_sleep_on_timeout() function calls
with direct wait-queue usage. I did not find the direct wake_up_interruptible()
function call in this file for the wait-queue, but that may not be an issue.
Patch is compile-tested.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.11-rc2-kj-v/drivers/net/8139too.c	2005-01-24 09:34:08.000000000 -0800
+++ 2.6.11-rc2-kj/drivers/net/8139too.c	2005-01-27 11:22:19.000000000 -0800
@@ -108,6 +108,7 @@
 #include <linux/mii.h>
 #include <linux/completion.h>
 #include <linux/crc32.h>
+#include <linux/wait.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/irq.h>
@@ -1612,6 +1613,7 @@ static inline void rtl8139_thread_iter (
 
 static int rtl8139_thread (void *data)
 {
+	DEFINE_WAIT(wait);
 	struct net_device *dev = data;
 	struct rtl8139_private *tp = dev->priv;
 	unsigned long timeout;
@@ -1622,7 +1624,9 @@ static int rtl8139_thread (void *data)
 	while (1) {
 		timeout = next_tick;
 		do {
-			timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
+			prepare_to_wait(&tp->thr_wait, &wait, TASK_INTERRUPTIBLE);
+			timeout = schedule_timeout(timeout);
+			finish_wait(&tp->thr_wait, &wait);
 			/* make swsusp happy with our thread */
 			try_to_freeze(PF_FREEZE);
 		} while (!signal_pending (current) && (timeout > 0));

[-- 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-02-02 18:11 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=20050202181129.GD2546@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).