diff options
author | pfg <pfg@FreeBSD.org> | 2016-05-11 00:59:06 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-05-11 00:59:06 +0000 |
commit | 4016f9c0340b871c6f27db10a7d86cb03a3fcf6a (patch) | |
tree | dc33a3dfc27306445a9812f835703ca9aa18cded | |
parent | 85aa8af6708f6cd2bda3d737261842559c1379f7 (diff) | |
download | FreeBSD-src-4016f9c0340b871c6f27db10a7d86cb03a3fcf6a.zip FreeBSD-src-4016f9c0340b871c6f27db10a7d86cb03a3fcf6a.tar.gz |
MFC r298703:
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.
-rw-r--r-- | sys/cam/cam_xpt.c | 6 | ||||
-rw-r--r-- | sys/cam/ctl/ctl.c | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 6773829..39ff577 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -1186,7 +1186,7 @@ xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1298,7 +1298,7 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_ed *device) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1421,7 +1421,7 @@ xptperiphmatch(struct dev_match_pattern *patterns, u_int num_patterns, 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. diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 1d0d9ce..5455eea 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -918,7 +918,7 @@ ctl_isc_announce_mode(struct ctl_lun *lun, uint32_t initidx, { 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; @@ -1286,7 +1286,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; @@ -6407,7 +6407,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) */ switch (page_code) { case SMS_ALL_PAGES_PAGE: { - int i; + u_int i; page_len = 0; @@ -6459,7 +6459,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) break; } default: { - int i; + u_int i; page_len = 0; @@ -12777,7 +12777,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; @@ -12855,7 +12855,7 @@ ctl_datamove_remote_dm_read_cb(union ctl_io *io) 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); @@ -13096,7 +13096,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 |