diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-26 15:03:15 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-26 15:03:15 +0000 |
commit | 057b4402bf634907fd03590e2757e09e975d04c7 (patch) | |
tree | df1bb710ebf946f1a7c1b38464ef836fddfee71c /sys/dev/fatm | |
parent | 768f89e0788ab1ab7ea5df9d57082f53567007ec (diff) | |
download | src-057b4402bf634907fd03590e2757e09e975d04c7.tar.gz src-057b4402bf634907fd03590e2757e09e975d04c7.zip |
sys/dev: extend use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
Notes
Notes:
svn path=/head/; revision=298646
Diffstat (limited to 'sys/dev/fatm')
-rw-r--r-- | sys/dev/fatm/if_fatm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index 9a42b932955a..83f43fd4ed52 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -1085,7 +1085,7 @@ fatm_supply_small_buffers(struct fatm_softc *sc) nbufs = min(nbufs, SMALL_POOL_SIZE); nbufs -= sc->small_cnt; - nblocks = (nbufs + SMALL_SUPPLY_BLKSIZE - 1) / SMALL_SUPPLY_BLKSIZE; + nblocks = howmany(nbufs, SMALL_SUPPLY_BLKSIZE); for (cnt = 0; cnt < nblocks; cnt++) { q = GET_QUEUE(sc->s1queue, struct supqueue, sc->s1queue.head); @@ -1174,7 +1174,7 @@ fatm_supply_large_buffers(struct fatm_softc *sc) nbufs = min(nbufs, LARGE_POOL_SIZE); nbufs -= sc->large_cnt; - nblocks = (nbufs + LARGE_SUPPLY_BLKSIZE - 1) / LARGE_SUPPLY_BLKSIZE; + nblocks = howmany(nbufs, LARGE_SUPPLY_BLKSIZE); for (cnt = 0; cnt < nblocks; cnt++) { q = GET_QUEUE(sc->l1queue, struct supqueue, sc->l1queue.head); |