netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinay K Nallamothu <vinay-rc@naturesoft.net>
To: Marcelo Tosatti <marcelo@hera.kernel.org>
Cc: netdev@oss.sgi.com, Jesse Barnes <jbarnes@sgi.com>,
	Alan Cox <alan@redhat.com>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.4.21][FIX] use mod_timer
Date: 20 Jun 2003 12:06:40 +0530	[thread overview]
Message-ID: <1056091000.1200.23.camel@lima.royalchallenge.com> (raw)

Hi,

This patch makes use of mod_timer instead of {del,add}_timer.

Most of the patches already in -ac series since 2.4.21-rc2 and few of
the networking fixes in 2.5.69

The following files are affected:

arch/ia64/sn/kernel/irq.c
arch/ia64/sn/kernel/mca.c
drivers/block/floppy.c
drivers/net/wan/sdla_chdlc.c
drivers/net/wan/sdla_fr.c
drivers/net/wan/sdla_x25.c
net/core/dst.c
net/sched/sch_cbq.c
net/sched/sch_csz.c
net/sched/sch_htb.c


diff -urN linux-2.4.21/arch/ia64/sn/kernel/irq.c linux-2.4.21-nvk/arch/ia64/sn/kernel/irq.c
--- linux-2.4.21/arch/ia64/sn/kernel/irq.c	2003-06-14 10:09:52.000000000 +0530
+++ linux-2.4.21-nvk/arch/ia64/sn/kernel/irq.c	2003-06-20 10:38:47.000000000 +0530
@@ -303,9 +303,7 @@
 			bridge->b_force_always[intr_test_registered[i].slot].intr = 1;
 		}
 	}
-	del_timer(&intr_test_timer);
-	intr_test_timer.expires = jiffies + HZ/100;
-	add_timer(&intr_test_timer);
+	mod_timer(&intr_test_timer, jiffies + HZ/100);
 }
 
 void
diff -urN linux-2.4.21/arch/ia64/sn/kernel/mca.c linux-2.4.21-nvk/arch/ia64/sn/kernel/mca.c
--- linux-2.4.21/arch/ia64/sn/kernel/mca.c	2003-06-14 10:09:52.000000000 +0530
+++ linux-2.4.21-nvk/arch/ia64/sn/kernel/mca.c	2003-06-20 11:00:11.000000000 +0530
@@ -123,9 +123,7 @@
 static void
 sn_cpei_timer_handler(unsigned long dummy) {
 	sn_cpei_handler(-1, NULL, NULL);
-	del_timer(&sn_cpei_timer);
-	sn_cpei_timer.expires = jiffies + CPEI_INTERVAL;
-        add_timer(&sn_cpei_timer);
+	mod_timer(&sn_cpei_timer, jiffies + CPEI_INTERVAL);
 }
 
 void
@@ -147,9 +145,7 @@
 	unsigned long *pi_ce_error_inject_reg = 0xc00000092fffff00;
 
 	*pi_ce_error_inject_reg = 0x0000000000000100;
-	del_timer(&sn_ce_timer);
-	sn_ce_timer.expires = jiffies + CPEI_INTERVAL;
-        add_timer(&sn_ce_timer);
+	mod_timer(&sn_ce_timer, jiffies + CPEI_INTERVAL);
 }
 
 sn_init_ce_timer() {
diff -urN linux-2.4.21/drivers/net/wan/sdla_chdlc.c linux-2.4.21-nvk/drivers/net/wan/sdla_chdlc.c
--- linux-2.4.21/drivers/net/wan/sdla_chdlc.c	2003-06-14 10:03:17.000000000 +0530
+++ linux-2.4.21-nvk/drivers/net/wan/sdla_chdlc.c	2003-06-20 10:38:40.000000000 +0530
@@ -1089,13 +1089,11 @@
 	
 	set_bit(0,&chdlc_priv_area->config_chdlc);
 	chdlc_priv_area->config_chdlc_timeout=jiffies;
-	del_timer(&chdlc_priv_area->poll_delay_timer);
 
 	/* Start the CHDLC configuration after 1sec delay.
 	 * This will give the interface initilization time
 	 * to finish its configuration */
-	chdlc_priv_area->poll_delay_timer.expires=jiffies+HZ;
-	add_timer(&chdlc_priv_area->poll_delay_timer);
+	mod_timer(&chdlc_priv_area->poll_delay_timer, jiffies + HZ);
 	return err;
 }
 
diff -urN linux-2.4.21/drivers/net/wan/sdla_fr.c linux-2.4.21-nvk/drivers/net/wan/sdla_fr.c
--- linux-2.4.21/drivers/net/wan/sdla_fr.c	2003-06-14 10:03:17.000000000 +0530
+++ linux-2.4.21-nvk/drivers/net/wan/sdla_fr.c	2003-06-20 10:38:31.000000000 +0530
@@ -4541,9 +4541,7 @@
 {
 	fr_channel_t* chan = dev->priv;
 
-	del_timer(&chan->fr_arp_timer);
-	chan->fr_arp_timer.expires = jiffies + (chan->inarp_interval * HZ);
-	add_timer(&chan->fr_arp_timer);
+	mod_timer(&chan->fr_arp_timer, jiffies + chan->inarp_interval * HZ);
 	return;
 }
 
diff -urN linux-2.4.21/drivers/net/wan/sdla_ppp.c linux-2.4.21-nvk/drivers/net/wan/sdla_ppp.c
--- linux-2.4.21/drivers/net/wan/sdla_ppp.c	2003-06-14 10:03:17.000000000 +0530
+++ linux-2.4.21-nvk/drivers/net/wan/sdla_ppp.c	2003-06-20 10:34:06.000000000 +0530
@@ -841,9 +841,7 @@
 	/* Start the PPP configuration after 1sec delay.
 	 * This will give the interface initilization time
 	 * to finish its configuration */
-	del_timer(&ppp_priv_area->poll_delay_timer);
-	ppp_priv_area->poll_delay_timer.expires = jiffies+HZ;
-	add_timer(&ppp_priv_area->poll_delay_timer);
+	mod_timer(&ppp_priv_area->poll_delay_timer, jiffies + HZ);
 	return 0;
 }
 
diff -urN linux-2.4.21/drivers/net/wan/sdla_x25.c linux-2.4.21-nvk/drivers/net/wan/sdla_x25.c
--- linux-2.4.21/drivers/net/wan/sdla_x25.c	2003-06-14 10:10:14.000000000 +0530
+++ linux-2.4.21-nvk/drivers/net/wan/sdla_x25.c	2003-06-20 10:33:30.000000000 +0530
@@ -1267,9 +1267,7 @@
 			connect(card);
 			S508_S514_unlock(card, &smp_flags);
 
-			del_timer(&card->u.x.x25_timer);
-			card->u.x.x25_timer.expires=jiffies+HZ;
-			add_timer(&card->u.x.x25_timer);
+			mod_timer(&card->u.x.x25_timer, jiffies + HZ);
 		}
 	}
 	/* Device is not up until the we are in connected state */
diff -urN linux-2.4.21/net/core/dst.c linux-2.4.21-nvk/net/core/dst.c
--- linux-2.4.21/net/core/dst.c	2003-06-14 10:03:10.000000000 +0530
+++ linux-2.4.21-nvk/net/core/dst.c	2003-06-20 10:33:16.000000000 +0530
@@ -131,11 +131,9 @@
 	dst->next = dst_garbage_list;
 	dst_garbage_list = dst;
 	if (dst_gc_timer_inc > DST_GC_INC) {
-		del_timer(&dst_gc_timer);
 		dst_gc_timer_inc = DST_GC_INC;
 		dst_gc_timer_expires = DST_GC_MIN;
-		dst_gc_timer.expires = jiffies + dst_gc_timer_expires;
-		add_timer(&dst_gc_timer);
+		mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires);
 	}
 
 	spin_unlock_bh(&dst_lock);
diff -urN linux-2.4.21/net/sched/sch_cbq.c linux-2.4.21-nvk/net/sched/sch_cbq.c
--- linux-2.4.21/net/sched/sch_cbq.c	2003-06-14 10:03:13.000000000 +0530
+++ linux-2.4.21-nvk/net/sched/sch_cbq.c	2003-06-20 10:38:53.000000000 +0530
@@ -1056,11 +1056,9 @@
 		sch->stats.overlimits++;
 		if (q->wd_expires && !netif_queue_stopped(sch->dev)) {
 			long delay = PSCHED_US2JIFFIE(q->wd_expires);
-			del_timer(&q->wd_timer);
 			if (delay <= 0)
 				delay = 1;
-			q->wd_timer.expires = jiffies + delay;
-			add_timer(&q->wd_timer);
+			mod_timer(&q->wd_timer, jiffies + delay);
 			sch->flags |= TCQ_F_THROTTLED;
 		}
 	}
diff -urN linux-2.4.21/net/sched/sch_csz.c linux-2.4.21-nvk/net/sched/sch_csz.c
--- linux-2.4.21/net/sched/sch_csz.c	2003-06-14 10:10:35.000000000 +0530
+++ linux-2.4.21-nvk/net/sched/sch_csz.c	2003-06-20 10:38:59.000000000 +0530
@@ -708,11 +708,9 @@
 	 */
 	if (q->wd_expires) {
 		unsigned long delay = PSCHED_US2JIFFIE(q->wd_expires);
-		del_timer(&q->wd_timer);
 		if (delay == 0)
 			delay = 1;
-		q->wd_timer.expires = jiffies + delay;
-		add_timer(&q->wd_timer);
+		mod_timer(&q->wd_timer, jiffies + delay);
 		sch->stats.overlimits++;
 	}
 #endif
diff -urN linux-2.4.21/net/sched/sch_htb.c linux-2.4.21-nvk/net/sched/sch_htb.c
--- linux-2.4.21/net/sched/sch_htb.c	2003-06-14 10:10:35.000000000 +0530
+++ linux-2.4.21-nvk/net/sched/sch_htb.c	2003-06-20 10:39:05.000000000 +0530
@@ -986,9 +986,7 @@
 			printk(KERN_INFO "HTB delay %ld > 5sec\n", delay);
 		delay = 5*HZ;
 	}
-	del_timer(&q->timer);
-	q->timer.expires = jiffies + delay;
-	add_timer(&q->timer);
+	mod_timer(&q->timer, jiffies + delay);
 	sch->flags |= TCQ_F_THROTTLED;
 	sch->stats.overlimits++;
 	HTB_DBG(3,1,"htb_deq t_delay=%ld\n",delay);
diff -urN linux-2.4.21/drivers/block/floppy.c linux-2.4.21-nvk/drivers/block/floppy.c
--- linux-2.4.21/drivers/block/floppy.c	2003-06-14 10:03:23.000000000 +0530
+++ linux-2.4.21-nvk/drivers/block/floppy.c	2003-06-20 10:44:28.000000000 +0530
@@ -652,15 +652,16 @@
 
 static void reschedule_timeout(int drive, const char *message, int marg)
 {
+	unsigned long delay;
+	
 	if (drive == CURRENTD)
 		drive = current_drive;
-	del_timer(&fd_timeout);
 	if (drive < 0 || drive > N_DRIVE) {
-		fd_timeout.expires = jiffies + 20UL*HZ;
+		delay = 20UL*HZ;
 		drive=0;
 	} else
-		fd_timeout.expires = jiffies + UDP->timeout;
-	add_timer(&fd_timeout);
+		delay =  UDP->timeout;
+	mod_timer(&fd_timeout, delay + jiffies);
 	if (UDP->flags & FD_DEBUG){
 		DPRINT("reschedule timeout ");
 		printk(message, marg);

             reply	other threads:[~2003-06-20  6:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-20  6:36 Vinay K Nallamothu [this message]
2003-06-20  9:10 ` [PATCH 2.4.21][FIX] use mod_timer James Morris
2003-06-20 17:05   ` David S. Miller
2003-06-20 17:03 ` David S. Miller

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=1056091000.1200.23.camel@lima.royalchallenge.com \
    --to=vinay-rc@naturesoft.net \
    --cc=alan@redhat.com \
    --cc=jbarnes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@hera.kernel.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).