[lkml]   [2000]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: linux-2.4.0-test8-pre5
On Wed, 6 Sep 2000, Peter Samuelson wrote:

> > - VIA ide driver update (well, rewrite - the old one was buggy and broken)
> Can someone explain this line from the VIA update?
> #define FIT(v,min,max) (((v)>(max)?(max):(v))<(min)?(min):(v))
> Barring side effects on the variables, it is equivalent to
> #define FIT(v,min,max) ((v)<(min)?(min):(v))
> Why do I get the feeling that this was *not* the intent?

Correct. The last v should be replaced with whatever that we got from
(v)>(max)?(max):(v), like:

#define FIT(v,min,max) (((v)>(max)?(max):(v))<(min)?(min):((v)>(max)?(max):(v)))

Or perhaps this is a lot better:

#define FIT(v,min,max) ((v)>(max)?(max):((v)<(min)?(min):(v)))

Dan Aloni (dax)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:39    [W:0.053 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site