diff options
author | 2010-03-28 13:22:07 +0000 | |
---|---|---|
committer | 2010-03-28 13:22:07 +0000 | |
commit | 98c3fe3ea291b7d6138957cd6435b2132d39e3aa (patch) | |
tree | 4a73f2d7870593ee2e2cd8fe68886dec5bab9f1e | |
parent | Four uses of uninitialized variables found by clang via jsg@. ar5416, ar9287 (diff) | |
download | wireguard-openbsd-98c3fe3ea291b7d6138957cd6435b2132d39e3aa.tar.xz wireguard-openbsd-98c3fe3ea291b7d6138957cd6435b2132d39e3aa.zip |
Don't assign the same value to gatt->ag_size twice, also use ag_size in
a later calculation instead of doing it *again*
pointed out by miod quite some time ago.
-rw-r--r-- | sys/dev/pci/agp_amd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/pci/agp_amd.c b/sys/dev/pci/agp_amd.c index 58d0d582648..9fb2126ed92 100644 --- a/sys/dev/pci/agp_amd.c +++ b/sys/dev/pci/agp_amd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_amd.c,v 1.13 2009/05/10 16:57:44 oga Exp $ */ +/* $OpenBSD: agp_amd.c,v 1.14 2010/03/28 13:22:07 oga Exp $ */ /* $NetBSD: agp_amd.c,v 1.6 2001/10/06 02:48:50 thorpej Exp $ */ /*- @@ -133,13 +133,11 @@ agp_amd_alloc_gatt(bus_dma_tag_t dmat, bus_size_t apsize) gatt->ag_entries = entries; gatt->ag_virtual = (u_int32_t *)(vdir + AGP_PAGE_SIZE); gatt->ag_physical = gatt->ag_pdir + AGP_PAGE_SIZE; - gatt->ag_size = AGP_PAGE_SIZE + entries * sizeof(u_int32_t); /* * Map the pages of the GATT into the page directory. */ - npages = ((entries * sizeof(u_int32_t) + AGP_PAGE_SIZE - 1) - >> AGP_PAGE_SHIFT); + npages = ((gatt->ag_size - 1) >> AGP_PAGE_SHIFT); for (i = 0; i < npages; i++) gatt->ag_vdir[i] = (gatt->ag_physical + i * AGP_PAGE_SIZE) | 1; |