summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccbb
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-08-09 20:33:53 +0000
committerimp <imp@FreeBSD.org>2003-08-09 20:33:53 +0000
commit1cbf4845e485bfb0ea0089fec8e3c50016be45e2 (patch)
treec98bfbc10b29f7dd79d1fe234d81228a6fe94a37 /sys/dev/pccbb
parent5503a0baf54c056e2b2b58d512cdf9bc3eec04f4 (diff)
downloadFreeBSD-src-1cbf4845e485bfb0ea0089fec8e3c50016be45e2.zip
FreeBSD-src-1cbf4845e485bfb0ea0089fec8e3c50016be45e2.tar.gz
Add comments about some alignment that looks a little strange.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r--sys/dev/pccbb/pccbb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index e7c9096..706f1bc 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -1398,6 +1398,13 @@ cbb_cardbus_auto_open(struct cbb_softc *sc, int type)
else
align = 1;
+ /*
+ * This looks somewhat bogus, and doesn't seem to really respect
+ * alignment. The alignment stuff is happening too late (it
+ * should happen at allocation time, not activation time) and
+ * this code looks generally to be too complex for the purpose
+ * it surves.
+ */
SLIST_FOREACH(rle, &sc->rl, link) {
if (rle->type != type)
;
@@ -1465,9 +1472,9 @@ cbb_cardbus_auto_open(struct cbb_softc *sc, int type)
if (starts[1] != 0xffffffff)
starts[1] -= starts[1] % align;
if (ends[0] % align != 0)
- ends[0] += align - ends[0]%align - 1;
+ ends[0] += align - ends[0] % align - 1;
if (ends[1] % align != 0)
- ends[1] += align - ends[1]%align - 1;
+ ends[1] += align - ends[1] % align - 1;
}
if (type == SYS_RES_MEMORY) {
OpenPOWER on IntegriCloud