Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Apr 2017 20:46:34 +0000 (UTC)
From:      Scott Long <scottl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317213 - head/sys/cam/scsi
Message-ID:  <201704202046.v3KKkYlK088967@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scottl
Date: Thu Apr 20 20:46:34 2017
New Revision: 317213
URL: https://svnweb.freebsd.org/changeset/base/317213

Log:
  Reorder the minimum_cmd_size code to make it a little smaller and
  easier to read.

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Thu Apr 20 20:06:51 2017	(r317212)
+++ head/sys/cam/scsi/scsi_da.c	Thu Apr 20 20:46:34 2017	(r317213)
@@ -2500,17 +2500,15 @@ daregister(struct cam_periph *periph, vo
 	/*
 	 * 6, 10, 12 and 16 are the currently permissible values.
 	 */
-	if (softc->minimum_cmd_size < 6)
-		softc->minimum_cmd_size = 6;
-	else if ((softc->minimum_cmd_size > 6)
-	      && (softc->minimum_cmd_size <= 10))
-		softc->minimum_cmd_size = 10;
-	else if ((softc->minimum_cmd_size > 10)
-	      && (softc->minimum_cmd_size <= 12))
-		softc->minimum_cmd_size = 12;
-	else if (softc->minimum_cmd_size > 12)
+	if (softc->minimum_cmd_size > 12)
 		softc->minimum_cmd_size = 16;
-
+	else if (softc->minimum_cmd_size > 10)
+		softc->minimum_cmd_size = 12;
+	else if (softc->minimum_cmd_size > 6)
+		softc->minimum_cmd_size = 10;
+	else
+		softc->minimum_cmd_size = 6;
+		
 	/* Predict whether device may support READ CAPACITY(16). */
 	if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 &&
 	    (softc->quirks & DA_Q_NO_RC16) == 0) {



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