summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio/sio.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-04-30 21:39:28 +0000
committerpeter <peter@FreeBSD.org>2003-04-30 21:39:28 +0000
commit4a196916ac6a4fdda3f3391042fce853ddd9e143 (patch)
tree2ecf56bb3441d2c48b4fd5182a63239f464974cc /sys/dev/sio/sio.c
parent89556f048c2534e714d6531a6f545c8746e63472 (diff)
downloadFreeBSD-src-4a196916ac6a4fdda3f3391042fce853ddd9e143.zip
FreeBSD-src-4a196916ac6a4fdda3f3391042fce853ddd9e143.tar.gz
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.
Diffstat (limited to 'sys/dev/sio/sio.c')
-rw-r--r--sys/dev/sio/sio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 4d294df..96968d9 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -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);
OpenPOWER on IntegriCloud