> Date: Sun, 12 Jan 2020 13:09:23 +0100 > From: Martin Pieuchot <[email protected]> > > Now that tsleep_nsec(9) has the same behavior as tsleep(9) the > conversion be low should be safe. > > Ok?
ok kettenis@ > Index: uthum.c > =================================================================== > RCS file: /cvs/src/sys/dev/usb/uthum.c,v > retrieving revision 1.32 > diff -u -p -r1.32 uthum.c > --- uthum.c 9 Jan 2017 14:44:28 -0000 1.32 > +++ uthum.c 1 Jan 2020 14:27:59 -0000 > @@ -311,7 +311,8 @@ uthum_issue_cmd(struct uthum_softc *sc, > > /* wait if required */ > if (delay > 0) > - tsleep(&sc->sc_sensortask, 0, "uthum", (delay*hz+999)/1000 + 1); > + tsleep_nsec(&sc->sc_sensortask, 0, "uthum", > + MSEC_TO_NSEC(delay)); > > return 0; > } > @@ -337,7 +338,8 @@ uthum_read_data(struct uthum_softc *sc, > > /* wait if required */ > if (delay > 0) > - tsleep(&sc->sc_sensortask, 0, "uthum", (delay*hz+999)/1000 + 1); > + tsleep_nsec(&sc->sc_sensortask, 0, "uthum", > + MSEC_TO_NSEC(delay)); > > /* get answer */ > if (uhidev_get_report(sc->sc_hdev.sc_parent, UHID_FEATURE_REPORT, > >
