lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-id: <642139641257723381@karneval.cz>
Date:	Tue, 31 Oct 2006 01:42:17 +0100 (CET)
From:	Jiri Slaby <jirislaby@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	<support@...cialix.co.uk>
Subject: [PATCH 5/9] Char: sx, simplify timer logic

sx, simplify timer logic

Use kernel helpers for changing timer internals.

Signed-off-by: Jiri Slaby <jirislaby@...il.com>

---
commit ff54cb9cb0f690ad9414bc8c800b8fdfb38199a2
tree e3af70b31ec8df40137157f21e0e7641b4e3bf15
parent 10fd13e67b848584d1553b524d2e925ad60a1b4f
author Jiri Slaby <jirislaby@...il.com> Tue, 31 Oct 2006 00:43:49 +0100
committer Jiri Slaby <jirislaby@...il.com> Tue, 31 Oct 2006 00:43:49 +0100

 drivers/char/sx.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index fe5fabb..3e71bf8 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1304,10 +1304,7 @@ static void sx_pollfunc(unsigned long da
 
 	sx_interrupt(0, board);
 
-	init_timer(&board->timer);
-
-	board->timer.expires = jiffies + sx_poll;
-	add_timer(&board->timer);
+	mod_timer(&board->timer, jiffies + sx_poll);
 	func_exit();
 }
 
@@ -2006,14 +2003,10 @@ static int sx_init_board(struct sx_board
 
 		/* The timer should be initialized anyway: That way we can
 		   safely del_timer it when the module is unloaded. */
-		init_timer(&board->timer);
+		setup_timer(&board->timer, sx_pollfunc, (unsigned long)board);
 
-		if (board->poll) {
-			board->timer.data = (unsigned long)board;
-			board->timer.function = sx_pollfunc;
-			board->timer.expires = jiffies + board->poll;
-			add_timer(&board->timer);
-		}
+		if (board->poll)
+			mod_timer(&board->timer, jiffies + board->poll);
 	} else {
 		board->irq = 0;
 	}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ