From owner-svn-src-head@freebsd.org Wed Apr 27 15:35:07 2016 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 1245EB1E02D; Wed, 27 Apr 2016 15:35:07 +0000 (UTC) (envelope-from pfg@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 BAFB31FB4; Wed, 27 Apr 2016 15:35:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RFZ586085238; Wed, 27 Apr 2016 15:35:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RFZ5i1085236; Wed, 27 Apr 2016 15:35:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604271535.u3RFZ5i1085236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Apr 2016 15:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298703 - in head/sys/cam: . ctl 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.21 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: Wed, 27 Apr 2016 15:35:07 -0000 Author: pfg Date: Wed Apr 27 15:35:05 2016 New Revision: 298703 URL: https://svnweb.freebsd.org/changeset/base/298703 Log: cam: unsign some types to match their definitions and avoid overflows. numpatterns is u_int. ctl: CTL_NUM_MODE_PAGES comes from sizeof(). In struct:ctl_scsiio, kern_sg_entries is uint32_t. MFC after: 2 weeks Modified: head/sys/cam/cam_xpt.c head/sys/cam/ctl/ctl.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Apr 27 15:28:25 2016 (r298702) +++ head/sys/cam/cam_xpt.c Wed Apr 27 15:35:05 2016 (r298703) @@ -1182,7 +1182,7 @@ xptbusmatch(struct dev_match_pattern *pa struct cam_eb *bus) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1294,7 +1294,7 @@ xptdevicematch(struct dev_match_pattern struct cam_ed *device) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1417,7 +1417,7 @@ xptperiphmatch(struct dev_match_pattern struct cam_periph *periph) { dev_match_ret retval; - int i; + u_int i; /* * If we aren't given something to match against, that's an error. Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Apr 27 15:28:25 2016 (r298702) +++ head/sys/cam/ctl/ctl.c Wed Apr 27 15:35:05 2016 (r298703) @@ -916,7 +916,7 @@ ctl_isc_announce_mode(struct ctl_lun *lu { struct ctl_softc *softc = lun->ctl_softc; union ctl_ha_msg msg; - int i; + u_int i; if (softc->ha_link != CTL_HA_LINK_ONLINE) return; @@ -1284,7 +1284,7 @@ static void ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_ha_msg *msg, int len) { struct ctl_lun *lun; - int i; + u_int i; uint32_t initidx, targ_lun; targ_lun = msg->hdr.nexus.targ_mapped_lun; @@ -6405,7 +6405,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) */ switch (page_code) { case SMS_ALL_PAGES_PAGE: { - int i; + u_int i; page_len = 0; @@ -6457,7 +6457,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) break; } default: { - int i; + u_int i; page_len = 0; @@ -12775,7 +12775,7 @@ static void ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq) { union ctl_io *io; - int i; + uint32_t i; io = rq->context; @@ -12853,7 +12853,7 @@ ctl_datamove_remote_dm_read_cb(union ctl char path_str[64]; struct sbuf sb; #endif - int i; + uint32_t i; for (i = 0; i < io->scsiio.kern_sg_entries; i++) free(io->io_hdr.local_sglist[i].addr, M_CTL); @@ -13094,7 +13094,7 @@ static void ctl_datamove_remote_read(union ctl_io *io) { int retval; - int i; + uint32_t i; /* * This will send an error to the other controller in the case of a