Eliminate a compiler warning with gcc3.3 on AMD64, where speed is

a 32 bit int which can never be > ULONG_MAX / 8.  Its an 'always true'
warning.
This commit is contained in:
peter 2003-04-30 21:39:28 +00:00
parent e47c1ee21c
commit edf00106e3

View File

@ -1542,8 +1542,12 @@ siodivisor(rclk, speed)
u_int divisor;
int error;
if (speed == 0 || speed > (ULONG_MAX - 1) / 8)
if (speed == 0)
return (0);
#if UINT_MAX > (ULONG_MAX - 1) / 8
if (speed > (ULONG_MAX - 1) / 8)
return (0);
#endif
divisor = (rclk / (8UL * speed) + 1) / 2;
if (divisor == 0 || divisor >= 65536)
return (0);