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]
Date:	Sun, 22 Oct 2006 02:54:28 +0200 (CEST)
From:	Jiri Slaby <jirislaby@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	<linux-kernel@...r.kernel.org>
Subject: [PATCH 1/3] Char: isicom, use completion

isicom, use completion

use wait_for_completion+complete instead of variables+msleep hack.

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

---
commit 12be27655354f888150bbb720614dfba48cecdaf
tree a41af90a51a6de23bbae8ee7109a33a7fef23154
parent e6ef63223d0b6c4a72f815b8a42584d346980c82
author Jiri Slaby <jirislaby@...il.com> Sat, 21 Oct 2006 21:50:40 +0200
committer Jiri Slaby <jirislaby@...il.com> Sat, 21 Oct 2006 21:50:40 +0200

 drivers/char/isicom.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index db57da6..a8cfdf5 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -172,6 +172,7 @@ static struct pci_driver isicom_driver =
 static int prev_card = 3;	/*	start servicing isi_card[0]	*/
 static struct tty_driver *isicom_normal;
 
+static DECLARE_COMPLETION(isi_timerdone);
 static struct timer_list tx;
 static char re_schedule = 1;
 
@@ -514,7 +515,7 @@ static void isicom_tx(unsigned long _dat
 	/*	schedule another tx for hopefully in about 10ms	*/
 sched_again:
 	if (!re_schedule) {
-		re_schedule = 2;
+		complete(&isi_timerdone);
  		return;
 	}
 
@@ -1923,12 +1924,9 @@ error:
 
 static void __exit isicom_exit(void)
 {
-	unsigned int index = 0;
-
 	re_schedule = 0;
 
-	while (re_schedule != 2 && index++ < 100)
-		msleep(10);
+	wait_for_completion_timeout(&isi_timerdone, HZ);
 
 	pci_unregister_driver(&isicom_driver);
 	tty_unregister_driver(isicom_normal);
-
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