Subject: Re: timeout issue in scsi drivers: mstohz()
From: David Laight <email@example.com>
Date: 04/05/2002 00:21:46
On Thu, Apr 04, 2002 at 10:22:40PM +0200, Manuel Bouyer wrote:
> On Thu, Apr 04, 2002 at 09:53:50PM +0200, Manuel Bouyer wrote:
> > > #define mstohz(ms) \
> > > (__predict_false((ms) >= 0x10000u) ? \
> > > ((ms) + 0u) / 1000u * hz : \
> > > ((ms) + 0u) * hz / 1000u)
> Is this enouth in case ms isn't an integer but something smaller (say
> a char) ? Should (ms) be casted to (u_int) to be safe ?
I dislike casts in these sort of cases, I think you will find that
0u is an integer constant - so adding it will force a char or
short type to be extended.
What you don't want is to allow a pointer type!
David Laight: firstname.lastname@example.org