summaryrefslogtreecommitdiffstats
path: root/sys/geom/raid/md_intel.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-26 15:38:17 +0000
committerpfg <pfg@FreeBSD.org>2016-04-26 15:38:17 +0000
commitfc01419148d065603607b1008d536431465f3bc3 (patch)
tree1bff72784c0591a61e4e16e97fae48d0614891dc /sys/geom/raid/md_intel.c
parent3a3f015eb3ae533a46cf30b5262d15cb4b5db097 (diff)
downloadFreeBSD-src-fc01419148d065603607b1008d536431465f3bc3.zip
FreeBSD-src-fc01419148d065603607b1008d536431465f3bc3.tar.gz
sys: 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.
Diffstat (limited to 'sys/geom/raid/md_intel.c')
-rw-r--r--sys/geom/raid/md_intel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/raid/md_intel.c b/sys/geom/raid/md_intel.c
index 6d12602..11c561c 100644
--- a/sys/geom/raid/md_intel.c
+++ b/sys/geom/raid/md_intel.c
@@ -773,7 +773,7 @@ intel_meta_write(struct g_consumer *cp, struct intel_raid_conf *meta)
meta->checksum = checksum;
/* Create and fill buffer. */
- sectors = (meta->config_size + pp->sectorsize - 1) / pp->sectorsize;
+ sectors = howmany(meta->config_size, pp->sectorsize);
buf = malloc(sectors * pp->sectorsize, M_MD_INTEL, M_WAITOK | M_ZERO);
if (sectors > 1) {
memcpy(buf, ((char *)meta) + pp->sectorsize,
OpenPOWER on IntegriCloud