summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-12-05 18:42:13 +0000
committerkrw <krw@openbsd.org>2019-12-05 18:42:13 +0000
commit85f9847c37acba9e95ee25da7430ccfbfa06a4ef (patch)
tree5565b8d65848a26c3980a6fe9244b264cdee7f1f /sys/scsi/scsi_base.c
parentNo need for 'byte2' parameter to scsi_mode_sense[_big]() since we (diff)
downloadwireguard-openbsd-85f9847c37acba9e95ee25da7430ccfbfa06a4ef.tar.xz
wireguard-openbsd-85f9847c37acba9e95ee25da7430ccfbfa06a4ef.zip
Shrink scsi_mode_do_sense() parameter list by eliminating the three
pointers returning possible block descriptor values for block size, block count and density. Most calls were passing "NULL, NULL, NULL" since they did not care. Call scsi_parse_blkdesc() directly in those few cases where one or more of the values is of interest. No intentional functional change.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 1b301319ce2..2b5d522bd6a 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.257 2019/12/05 16:33:53 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.258 2019/12/05 18:42:14 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -1253,9 +1253,8 @@ scsi_parse_blkdesc(struct scsi_link *link, union scsi_mode_sense_buf *buf,
int
scsi_do_mode_sense(struct scsi_link *link, int pg_code,
- union scsi_mode_sense_buf *buf, void **page_data, u_int32_t *density,
- u_int64_t *block_count, u_int32_t *block_size, int pg_length, int flags,
- int *big)
+ union scsi_mode_sense_buf *buf, void **page_data,
+ int pg_length, int flags, int *big)
{
int error;
@@ -1276,20 +1275,15 @@ scsi_do_mode_sense(struct scsi_link *link, int pg_code,
error = scsi_mode_sense(link, pg_code, &buf->hdr,
sizeof(*buf), flags, 20000);
if (error == 0) {
+ /*
+ * Page data may be invalid (e.g. all zeros) but we
+ * accept the device's word that this is the best it can
+ * do. Some devices will freak out if their word is not
+ * accepted and MODE_SENSE_BIG is attempted.
+ */
*page_data = scsi_mode_sense_page(&buf->hdr, pg_code,
pg_length);
- if (*page_data == NULL) {
- /*
- * XXX
- * Page data may be invalid (e.g. all zeros)
- * but we accept the device's word that this is
- * the best it can do. Some devices will freak
- * out if their word is not accepted and
- * MODE_SENSE_BIG is attempted.
- */
- return (0);
- }
- goto blk_desc;
+ return 0;
}
}
@@ -1314,9 +1308,6 @@ scsi_do_mode_sense(struct scsi_link *link, int pg_code,
*page_data = scsi_mode_sense_big_page(&buf->hdr_big, pg_code,
pg_length);
-blk_desc:
- scsi_parse_blkdesc(link, buf, *big, density, block_count, block_size);
-
return (0);
}