svn commit: r298601 - head/lib/libstand
Pedro F. Giffuni
pfg at FreeBSD.org
Tue Apr 26 01:19:38 UTC 2016
Author: pfg
Date: Tue Apr 26 01:19:36 2016
New Revision: 298601
URL: https://svnweb.freebsd.org/changeset/base/298601
Log:
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.
Modified:
head/lib/libstand/nandfs.c
Modified: head/lib/libstand/nandfs.c
==============================================================================
--- head/lib/libstand/nandfs.c Tue Apr 26 01:17:05 2016 (r298600)
+++ head/lib/libstand/nandfs.c Tue Apr 26 01:19:36 2016 (r298601)
@@ -1017,7 +1017,7 @@ ioread(struct open_file *f, off_t pos, v
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);
More information about the svn-src-all
mailing list