From owner-svn-src-head@freebsd.org Thu Apr 20 20:46:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB1ED48933; Thu, 20 Apr 2017 20:46:35 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 939681222; Thu, 20 Apr 2017 20:46:35 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KKkYRH088968; Thu, 20 Apr 2017 20:46:34 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KKkYlK088967; Thu, 20 Apr 2017 20:46:34 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201704202046.v3KKkYlK088967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 20 Apr 2017 20:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317213 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 20:46:35 -0000 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) {