Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2016 01:19:36 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298601 - head/lib/libstand
Message-ID:  <201604260119.u3Q1Ja69085198@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604260119.u3Q1Ja69085198>