From 4ac70c829cbf31c6e1ed2b2b91a33a0aa71a0319 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 7 Mar 2014 01:01:57 +0000 Subject: Slight if reordering to make error branch last. --- sbin/newfs_nandfs/newfs_nandfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/newfs_nandfs/newfs_nandfs.c b/sbin/newfs_nandfs/newfs_nandfs.c index 5242318ab9fd..fda2b9ed01ef 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); -- cgit v1.2.3