diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-08-29 16:07:20 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-08-29 16:07:20 +0000 |
commit | 19f0391214edff4f20640b888d7d010e6c81d781 (patch) | |
tree | ad0a60f46aac481729ec67f02ef0c097eee98738 /sys/scsi | |
parent | 01696c66bb8d8e7528dece42ba48e19e22cbb28d (diff) |
Use u_int32_t for nsecs, making it crystal clear that the values
are expected to fit into a 4-byte field.
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/cd.c | 15 | ||||
-rw-r--r-- | sys/scsi/sd.c | 13 |
2 files changed, 16 insertions, 12 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 34cdd71daef..30178cec612 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.257 2020/08/29 02:03:31 krw Exp $ */ +/* $OpenBSD: cd.c,v 1.258 2020/08/29 16:07:19 krw Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -111,8 +111,8 @@ struct cd_softc { void cdstart(struct scsi_xfer *); void cd_buf_done(struct scsi_xfer *); -int cd_cmd_rw6(struct scsi_generic *, int, u_int64_t, u_int); -int cd_cmd_rw10(struct scsi_generic *, int, u_int64_t, u_int); +int cd_cmd_rw6(struct scsi_generic *, int, u_int64_t, u_int32_t); +int cd_cmd_rw10(struct scsi_generic *, int, u_int64_t, u_int32_t); void cdminphys(struct buf *); int cdgetdisklabel(dev_t, struct cd_softc *, struct disklabel *, int); int cd_setchan(struct cd_softc *, int, int, int, int, int); @@ -485,7 +485,8 @@ done: } int -cd_cmd_rw6(struct scsi_generic *generic, int read, u_int64_t secno, u_int nsecs) +cd_cmd_rw6(struct scsi_generic *generic, int read, u_int64_t secno, + u_int32_t nsecs) { struct scsi_rw *cmd = (struct scsi_rw *)generic; @@ -497,7 +498,8 @@ cd_cmd_rw6(struct scsi_generic *generic, int read, u_int64_t secno, u_int nsecs) } int -cd_cmd_rw10(struct scsi_generic *generic, int read, u_int64_t secno, u_int nsecs) +cd_cmd_rw10(struct scsi_generic *generic, int read, u_int64_t secno, + u_int32_t nsecs) { struct scsi_rw_big *cmd = (struct scsi_rw_big *)generic; @@ -531,7 +533,8 @@ cdstart(struct scsi_xfer *xs) struct cd_softc *sc = link->device_softc; struct buf *bp; struct partition *p; - u_int64_t secno, nsecs; + u_int64_t secno; + u_int32_t nsecs; int read; SC_DEBUG(link, SDEV_DB2, ("cdstart\n")); diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 6845a0bdf79..9d7e812f341 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.322 2020/08/29 02:03:31 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.323 2020/08/29 16:07:19 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -103,10 +103,10 @@ void viscpy(u_char *, u_char *, int); int sd_ioctl_inquiry(struct sd_softc *, struct dk_inquiry *); int sd_ioctl_cache(struct sd_softc *, long, struct dk_cache *); -int sd_cmd_rw6(struct scsi_generic *, int, u_int64_t, u_int); -int sd_cmd_rw10(struct scsi_generic *, int, u_int64_t, u_int); -int sd_cmd_rw12(struct scsi_generic *, int, u_int64_t, u_int); -int sd_cmd_rw16(struct scsi_generic *, int, u_int64_t, u_int); +int sd_cmd_rw6(struct scsi_generic *, int, u_int64_t, u_int32_t); +int sd_cmd_rw10(struct scsi_generic *, int, u_int64_t, u_int32_t); +int sd_cmd_rw12(struct scsi_generic *, int, u_int64_t, u_int32_t); +int sd_cmd_rw16(struct scsi_generic *, int, u_int64_t, u_int32_t); void sd_buf_done(struct scsi_xfer *); @@ -653,8 +653,9 @@ sdstart(struct scsi_xfer *xs) struct sd_softc *sc = link->device_softc; struct buf *bp; struct partition *p; - int nsecs, read; u_int64_t secno; + u_int32_t nsecs; + int read; if (ISSET(sc->flags, SDF_DYING)) { scsi_xs_put(xs); |