ipmi(4): tsleep(9) -> tsleep_nsec(9)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ipmi(4): tsleep(9) -> tsleep_nsec(9)

Scott Cheloha
Ticks to seconds.  Easy.

There's a polling sleep earlier in the code that I'm going to
leave as-is for now.

ok?

Index: ipmi.c
===================================================================
RCS file: /cvs/src/sys/dev/ipmi.c,v
retrieving revision 1.108
diff -u -p -r1.108 ipmi.c
--- ipmi.c 11 Jan 2020 18:51:54 -0000 1.108
+++ ipmi.c 7 Feb 2020 14:08:28 -0000
@@ -55,7 +55,7 @@ struct ipmi_sensor {
 
 int ipmi_enabled = 0;
 
-#define SENSOR_REFRESH_RATE (5 * hz)
+#define SENSOR_REFRESH_RATE 5 /* seconds */
 
 #define DEVNAME(s)  ((s)->sc_dev.dv_xname)
 
@@ -1498,7 +1498,8 @@ ipmi_poll_thread(void *arg)
 
  while (thread->running) {
  ipmi_refresh_sensors(sc);
- tsleep(thread, PWAIT, "ipmi_poll", SENSOR_REFRESH_RATE);
+ tsleep_nsec(thread, PWAIT, "ipmi_poll",
+    SEC_TO_NSEC(SENSOR_REFRESH_RATE));
  }
 
 done: