patch-2.3.99-pre7 linux/drivers/char/softdog.c

Next file: linux/drivers/char/specialix.c
Previous file: linux/drivers/char/serial.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/drivers/char/softdog.c linux/drivers/char/softdog.c
@@ -83,9 +83,7 @@
 	/*
 	 *	Activate timer
 	 */
-	del_timer(&watchdog_ticktock);
-	watchdog_ticktock.expires=jiffies + (soft_margin * HZ);
-	add_timer(&watchdog_ticktock);
+	mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
 	timer_alive=1;
 	return 0;
 }
@@ -104,15 +102,6 @@
 	return 0;
 }
 
-static void softdog_ping(void)
-{
-	/*
-	 *	Refresh the timer.
-	 */
-
-	mod_timer(&watchdog_ticktock, jiffies + (soft_margin * HZ));
-}
-
 static ssize_t softdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
 {
 	/*  Can't seek (pwrite) on this device  */
@@ -122,9 +111,8 @@
 	/*
 	 *	Refresh the timer.
 	 */
-	if(len)
-	{
-		softdog_ping();
+	if(len) {
+		mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
 		return 1;
 	}
 	return 0;
@@ -151,7 +139,7 @@
 		case WDIOC_GETBOOTSTATUS:
 			return put_user(0,(int *)arg);
 		case WDIOC_KEEPALIVE:
-			softdog_ping();
+			mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
 			return 0;
 	}
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)