Skip to contentSkip to conversation

use new msleep() in ADT746x driver

PATCH Jeff Garzik 2 participants 3 messages May 29, 2004 – Jun 2, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

drivers/macintosh/therm_adt746x.c line 249

Quoted 10 lines · Linux Kernel Mailing List

diff -Nru a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c

drivers/macintosh/therm_adt746x.c +1 -2
@@ -246,8 +246,7 @@
 
 	while(monitor_running)
 	{
-		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(2*HZ);
+		msleep(2000);

IMO this is moving the code away from what the coder appeared to intend.

A "sleep(2)" would be preferred, and more clear.

Jeff

#2 lore raw
Quoted 15 lines · Jeff Garzik

drivers/macintosh/therm_adt746x.c line 249

Quoted 10 lines · Linux Kernel Mailing List

diff -Nru a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c

drivers/macintosh/therm_adt746x.c +1 -2
@@ -246,8 +246,7 @@
 
 	while(monitor_running)
 	{
-		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(2*HZ);
+		msleep(2000);

IMO this is moving the code away from what the coder appeared to intend.

Quoted 1 line

A "sleep(2)" would be preferred, and more clear.

This patch was done by the original author of the driver

Ben.

#3 lore raw
Quoted 18 lines · Benjamin Herrenschmidt
Quoted 16 lines · Jeff Garzik

drivers/macintosh/therm_adt746x.c line 249

Quoted 10 lines · Linux Kernel Mailing List

diff -Nru a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c

drivers/macintosh/therm_adt746x.c +1 -2
@@ -246,8 +246,7 @@
 
 	while(monitor_running)
 	{
-		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(2*HZ);
+		msleep(2000);

IMO this is moving the code away from what the coder appeared to intend.

Quoted 4 lines
Quoted 1 line

A "sleep(2)" would be preferred, and more clear.

This patch was done by the original author of the driver

Well, I think the author is making his driver less readable... "2 seconds" is more clear than "2000 msec", and I am willing to bet that sleep() would have been used, had it existed.

Jeff