summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-26 01:19:36 +0000
committerpfg <pfg@FreeBSD.org>2016-04-26 01:19:36 +0000
commitc26598f6f0ea549cd5b94cffa114ff79ca06d82b (patch)
tree2c05cf0320fd7ec0ea9cfcfe2da8fb7243e4ac40 /lib/libstand
parent4f3667123ffa7c2a0e85e234b34ef32232a438c0 (diff)
downloadFreeBSD-src-c26598f6f0ea549cd5b94cffa114ff79ca06d82b.zip
FreeBSD-src-c26598f6f0ea549cd5b94cffa114ff79ca06d82b.tar.gz
libstand: make more 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.
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/nandfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libstand/nandfs.c b/lib/libstand/nandfs.c
index 3d039cf..e530fa6 100644
--- a/lib/libstand/nandfs.c
+++ b/lib/libstand/nandfs.c
@@ -1017,7 +1017,7 @@ ioread(struct open_file *f, off_t pos, void *buf, u_int length)
off = pos % bsize;
pos /= bsize;
- nsec = (length + (bsize - 1)) / bsize;
+ nsec = howmany(length, bsize);
NANDFS_DEBUG("pos=%lld length=%d off=%d nsec=%d\n", pos, length,
off, nsec);
OpenPOWER on IntegriCloud