From owner-svn-src-all@freebsd.org Fri Dec 9 06:18:14 2016 Return-Path: Delivered-To: svn-src-all@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 0E483C6E943; Fri, 9 Dec 2016 06:18:14 +0000 (UTC) (envelope-from sephe@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 B995DD3F; Fri, 9 Dec 2016 06:18:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB96ICiX097774; Fri, 9 Dec 2016 06:18:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB96ICgE097773; Fri, 9 Dec 2016 06:18:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612090618.uB96ICgE097773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 9 Dec 2016 06:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309728 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 06:18:14 -0000 Author: sephe Date: Fri Dec 9 06:18:12 2016 New Revision: 309728 URL: https://svnweb.freebsd.org/changeset/base/309728 Log: hyperv/storvsc: Minor style changes; no functional changes. Reported by: rpokala MFC after: 1 week Sponsored by: Microsoft Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Dec 9 04:35:07 2016 (r309727) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri Dec 9 06:18:12 2016 (r309728) @@ -2057,6 +2057,7 @@ static uint32_t is_scsi_valid(const struct scsi_inquiry_data *inq_data) { u_int8_t type; + type = SID_TYPE(inq_data); if (type == T_NODEVICE) return (0); @@ -2064,6 +2065,7 @@ is_scsi_valid(const struct scsi_inquiry_ return (0); return (1); } + /** * @brief completion function before returning to CAM * @@ -2082,6 +2084,7 @@ storvsc_io_done(struct hv_storvsc_reques struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; + /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { ori_sglist = (bus_dma_segment_t *)ccb->csio.data_ptr; @@ -2136,6 +2139,7 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; + cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); @@ -2178,11 +2182,12 @@ storvsc_io_done(struct hv_storvsc_reques if (cmd->opcode == INQUIRY && vm_srb->srb_status == SRB_STATUS_SUCCESS) { int resp_xfer_len, resp_buf_len, data_len; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; struct scsi_inquiry_data *inq_data = (struct scsi_inquiry_data *)csio->data_ptr; + /* Get the buffer length reported by host */ resp_xfer_len = vm_srb->transfer_len; - uint8_t *resp_buf = (uint8_t *)csio->data_ptr; /* Get the available buffer length */ resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0;