summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-06-19 15:15:35 +0000
committerjhb <jhb@FreeBSD.org>2012-06-19 15:15:35 +0000
commit7a9968597c3b0607f5ee88254b24687d2da64e39 (patch)
treeb823f362d016650bb05cded4d06856f1caa7738c /sys/dev
parent8880820896ab336271689e12be0b90ea5f150155 (diff)
downloadFreeBSD-src-7a9968597c3b0607f5ee88254b24687d2da64e39.zip
FreeBSD-src-7a9968597c3b0607f5ee88254b24687d2da64e39.tar.gz
Fix another off-by-one error in the previous fix so that the new start
address is properly aligned. While here, use a simpler expression to align the new end address that we use elsewhere for aligning the end.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pci_pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index d47b299..4901c1d 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -913,7 +913,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
if (bootverbose)
printf("\tfront candidate range: %#lx-%#lx\n",
front, end_free);
- front &= ~(1ul << w->step) - 1;
+ front &= ~((1ul << w->step) - 1);
front = rman_get_start(w->res) - front;
} else
front = 0;
@@ -941,7 +941,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
if (bootverbose)
printf("\tback candidate range: %#lx-%#lx\n",
start_free, back);
- back = roundup2(back + 1, 1ul << w->step) - 1;
+ back |= (1ul << w->step) - 1;
back -= rman_get_end(w->res);
} else
back = 0;
OpenPOWER on IntegriCloud