diff options
author | Warner Losh <imp@FreeBSD.org> | 2003-08-09 20:33:53 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2003-08-09 20:33:53 +0000 |
commit | da57cf7c7e03081c506c6c3e92e2f9783afe56e2 (patch) | |
tree | c98bfbc10b29f7dd79d1fe234d81228a6fe94a37 /sys/dev/pccbb | |
parent | e3bf57b6c91e9d396af6f5b96d720349bcbbcc82 (diff) | |
download | src-da57cf7c7e03081c506c6c3e92e2f9783afe56e2.tar.gz src-da57cf7c7e03081c506c6c3e92e2f9783afe56e2.zip |
Add comments about some alignment that looks a little strange.
Notes
Notes:
svn path=/head/; revision=118701
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index e7c9096bbc84..706f1bc49f2b 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) { |