All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] 6/34: block/ataflop: replace sleep_on() with
Date: Tue, 25 Jan 2005 22:28:13 +0000	[thread overview]
Message-ID: <20050125222813.GG2689@us.ibm.com> (raw)

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

Hi,

Please consider applying.

Description: Use wait_event() instead of the deprecated sleep_on(). These
replacements are straight-forward. The middle change is more difficult, as it is
not a conditional sleep. Therefore, I have converted it to directly use a
locally defined wait-queue.

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

--- 2.6.11-rc2-kj-v/drivers/block/ataflop.c	2005-01-24 09:34:04.000000000 -0800
+++ 2.6.11-rc2-kj/drivers/block/ataflop.c	2005-01-25 14:27:36.000000000 -0800
@@ -67,6 +67,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/blkdev.h>
+#include <linux/wait.h>
 
 #include <asm/atafd.h>
 #include <asm/atafdreg.h>
@@ -643,6 +644,7 @@ static void fd_error( void )
 
 static int do_format(int drive, int type, struct atari_format_descr *desc)
 {
+	DEFINE_WAIT(wait);
 	unsigned char	*p;
 	int sect, nsect;
 	unsigned long	flags;
@@ -651,7 +653,7 @@ static int do_format(int drive, int type
 		drive, desc->track, desc->head, desc->sect_offset ));
 
 	local_irq_save(flags);
-	while( fdc_busy ) sleep_on( &fdc_wait );
+	wait_event(fdc_wait, !fdc_busy);
 	fdc_busy = 1;
 	stdma_lock(floppy_irq, NULL);
 	atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */
@@ -706,7 +708,9 @@ static int do_format(int drive, int type
 	ReqSide  = desc->head;
 	do_fd_action( drive );
 
-	sleep_on( &format_wait );
+	prepare_to_wait(&format_wait, &wait, TASK_UNINTERRUPTIBLE);
+	schedule();
+	finish_wait(&format_wait, &wait);
 
 	redo_fd_request();
 	return( FormatError ? -EIO : 0 );	
@@ -1477,7 +1481,7 @@ void do_fd_request(request_queue_t * q)
  	unsigned long flags;
 
 	DPRINT(("do_fd_request for pid %d\n",current->pid));
-	while( fdc_busy ) sleep_on( &fdc_wait );
+	wait_event(fdc_wait, !fdc_busy);
 	fdc_busy = 1;
 	stdma_lock(floppy_irq, NULL);
 

[-- 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-25 22:28 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=20050125222813.GG2689@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.