summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-03-07 01:01:57 +0000
committerimp <imp@FreeBSD.org>2014-03-07 01:01:57 +0000
commitebcdff1527268659a693cce2ce86364f3740d9b1 (patch)
tree86a879aabfa64bd4e6c11384b046dc6bb9fd71b3 /sbin
parent6908862999ed516ec158f353482c1e4559b6301c (diff)
downloadFreeBSD-src-ebcdff1527268659a693cce2ce86364f3740d9b1.zip
FreeBSD-src-ebcdff1527268659a693cce2ce86364f3740d9b1.tar.gz
Slight if reordering to make error branch last.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/newfs_nandfs/newfs_nandfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/newfs_nandfs/newfs_nandfs.c b/sbin/newfs_nandfs/newfs_nandfs.c
index 5242318..fda2b9ed 100644
--- a/sbin/newfs_nandfs/newfs_nandfs.c
+++ b/sbin/newfs_nandfs/newfs_nandfs.c
@@ -988,10 +988,10 @@ calculate_geometry(int fd)
/* Get storage erase unit size */
if (!is_nand)
erasesize = NANDFS_DEF_ERASESIZE;
- else if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) == -1)
- errx(1, "Cannot ioctl(NAND_IO_GET_CHIP_PARAM)");
- else
+ else if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) != -1)
erasesize = chip_params.page_size * chip_params.pages_per_block;
+ else
+ errx(1, "Cannot ioctl(NAND_IO_GET_CHIP_PARAM)");
debug("erasesize: %#jx", (uintmax_t)erasesize);
OpenPOWER on IntegriCloud