summaryrefslogtreecommitdiff
path: root/sys/dev/hatm/if_hatm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hatm/if_hatm.c')
-rw-r--r--sys/dev/hatm/if_hatm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c
index d1dd6b1dad289..c34ee0e910753 100644
--- a/sys/dev/hatm/if_hatm.c
+++ b/sys/dev/hatm/if_hatm.c
@@ -788,16 +788,14 @@ hatm_init_cm(struct hatm_softc *sc)
rsra = 0;
mlbm = ((rsra + IFP2IFATM(sc->ifp)->mib.max_vccs * 8) + 0x7ff) & ~0x7ff;
rabr = ((mlbm + numbuffs * 2) + 0x7ff) & ~0x7ff;
- sc->rsrb = ((rabr + 2048) + (2 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1)) &
- ~(2 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1);
+ sc->rsrb = roundup2(rabr + 2048, 2 * IFP2IFATM(sc->ifp)->mib.max_vccs);
tsra = 0;
sc->tsrb = tsra + IFP2IFATM(sc->ifp)->mib.max_vccs * 8;
sc->tsrc = sc->tsrb + IFP2IFATM(sc->ifp)->mib.max_vccs * 4;
sc->tsrd = sc->tsrc + IFP2IFATM(sc->ifp)->mib.max_vccs * 2;
tabr = sc->tsrd + IFP2IFATM(sc->ifp)->mib.max_vccs * 1;
- mtpd = ((tabr + 1024) + (16 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1)) &
- ~(16 * IFP2IFATM(sc->ifp)->mib.max_vccs - 1);
+ mtpd = roundup2(tabr + 1024, 16 * IFP2IFATM(sc->ifp)->mib.max_vccs);
DBG(sc, ATTACH, ("rsra=%x mlbm=%x rabr=%x rsrb=%x",
rsra, mlbm, rabr, sc->rsrb));