Subject: Re: timeout issue in scsi drivers: mstohz()
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 04/03/2002 12:33:33
On Wed, Apr 03, 2002 at 07:23:53PM +0900, Izumi Tsutsui wrote:
> In article <20020402205606.GA10346@antioche.eu.org>
> bouyer@antioche.eu.org wrote:
> 
> > cleaning up my mail I re-read the thread from june 2001 "problems with ahc vs.
> > format command" (http://mail-index.netbsd.org/tech-kern/2001/06/).
>  :
> > I implemented it this evening, and converted the SCSI drivers.
>  :
> > Comments ?
> 
> Looks good, but one question:
> 
> > #define mstohz(ms) \
> > 	(__predict_false((ms) >= 100000)) ? \
> > 	    (((ms) / 1000 + 1) * hz) : \
>                           ^^^
> What does this "+1" means?

As in this case ms >> 1000, it's not needed here.  I'll remove it.

> 
> > 	    (((ms) * hz) / 1000)
> 
> This should be (((ms) * hz) / 1000 + 1) instead?

Well, maybe, in order to make sure that the result is always >= 1. 
I don't think adding 1 tick to the timeout is a problem here.
What do other think ?

BTW, thanks for the comments.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--