Subject: Re: timeout issue in scsi drivers: mstohz()
To: David Laight <david@l8s.co.uk>
From: Andrey Petrov <petrov@netbsd.org>
List: tech-kern
Date: 04/04/2002 00:55:06
On Wed, Apr 03, 2002 at 10:17:31PM +0100, David Laight wrote:
>
> EEEK - you've added so many superfluous parentheses it is
> impossibly to spot you've missed the most important set!
>
Yeah, well spotted, but still not enought parentheses, what if one day
#define hz 0+1
> look what (fixed_delay + mstohz( ms )) evaluates to!
> try:
> #define mstohz(ms) \
> (__predict_false((ms) >= 0x10000u) ? \
> ((ms) + 0u) / 1000u * hz : \
> ((ms) + 0u) * hz / 1000u)
>
> David
>
> --
> David Laight: david@l8s.co.uk
Andrey