Add comments about some alignment that looks a little strange.

This commit is contained in:
Warner Losh 2003-08-09 20:33:53 +00:00
parent e3bf57b6c9
commit da57cf7c7e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118701

View File

@ -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) {