Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Mar 2014 01:01:57 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262880 - head/sbin/newfs_nandfs
Message-ID:  <201403070101.s2711v0A007970@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Mar  7 01:01:57 2014
New Revision: 262880
URL: http://svnweb.freebsd.org/changeset/base/262880

Log:
  Slight if reordering to make error branch last.

Modified:
  head/sbin/newfs_nandfs/newfs_nandfs.c

Modified: head/sbin/newfs_nandfs/newfs_nandfs.c
==============================================================================
--- head/sbin/newfs_nandfs/newfs_nandfs.c	Fri Mar  7 00:38:29 2014	(r262879)
+++ head/sbin/newfs_nandfs/newfs_nandfs.c	Fri Mar  7 01:01:57 2014	(r262880)
@@ -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);
 



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