summaryrefslogtreecommitdiffstats
path: root/sys/dev/agp/agp_intel.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2009-03-20 18:30:20 +0000
committerrnoland <rnoland@FreeBSD.org>2009-03-20 18:30:20 +0000
commitd58258f4be4ab1db1c0420c292f9fd7d63903e9f (patch)
tree0de2adce2fd530a8d132c3e844d042e636dfafa9 /sys/dev/agp/agp_intel.c
parenta78a8edecd6b534fd5e463b357b6f56a69c063c8 (diff)
downloadFreeBSD-src-d58258f4be4ab1db1c0420c292f9fd7d63903e9f.zip
FreeBSD-src-d58258f4be4ab1db1c0420c292f9fd7d63903e9f.tar.gz
vm_offset_t is unsigned and therefore can not be negative.
Avoid unnessecary compares. Found with: Coverity Prevent(tm) CID: 2362,4215,4214,4209,4208,2363,4211,4210,4213,4212 MFC after: 3 days
Diffstat (limited to 'sys/dev/agp/agp_intel.c')
-rw-r--r--sys/dev/agp/agp_intel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/agp/agp_intel.c b/sys/dev/agp/agp_intel.c
index 3463d82..ac10c8e 100644
--- a/sys/dev/agp/agp_intel.c
+++ b/sys/dev/agp/agp_intel.c
@@ -371,7 +371,7 @@ agp_intel_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
sc = device_get_softc(dev);
- if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+ if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
return (EINVAL);
sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 0x17;
@@ -385,7 +385,7 @@ agp_intel_unbind_page(device_t dev, vm_offset_t offset)
sc = device_get_softc(dev);
- if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
+ if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
return (EINVAL);
sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
OpenPOWER on IntegriCloud