From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marcelo Tosatti <marcelo@conectiva.com.br>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] Amiflop mod_timer()
Date: Sun, 13 Apr 2003 15:04:43 +0200 [thread overview]
Message-ID: <200304131304.h3DD4hxp001244@callisto.of.borg> (raw)
Amiga floppy driver: Convert {del,add}_timer() sequences to mod_timer().
--- linux-2.4.x/drivers/block/amiflop.c Fri Nov 8 18:43:37 2002
+++ linux-m68k-2.4.x/drivers/block/amiflop.c Sun Mar 16 12:25:58 2003
@@ -366,10 +366,8 @@
unit[nr].motor = 1;
fd_select(nr);
- del_timer(&motor_on_timer);
motor_on_timer.data = nr;
- motor_on_timer.expires = jiffies + HZ/2;
- add_timer(&motor_on_timer);
+ mod_timer(&motor_on_timer, jiffies + HZ/2);
on_attempts = 10;
sleep_on (&motor_wait);
@@ -427,11 +425,9 @@
int drive;
drive = nr & 3;
- del_timer(motor_off_timer + drive);
- motor_off_timer[drive].expires = jiffies + 3*HZ;
/* called this way it is always from interrupt */
motor_off_timer[drive].data = nr | 0x80000000;
- add_timer(motor_off_timer + drive);
+ mod_timer(motor_off_timer + drive, jiffies + 3*HZ);
}
static int fd_calibrate(int drive)
@@ -1466,10 +1462,7 @@
unit[drive].dirty = 1;
/* reset the timer */
- del_timer (flush_track_timer + drive);
-
- flush_track_timer[drive].expires = jiffies + 1;
- add_timer (flush_track_timer + drive);
+ mod_timer(flush_track_timer + drive, jiffies + 1);
restore_flags (flags);
break;
}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
reply other threads:[~2003-04-13 12:55 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=200304131304.h3DD4hxp001244@callisto.of.borg \
--to=geert@linux-m68k.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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).