summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-11-09 12:15:50 +0000
committerkrw <krw@openbsd.org>2019-11-09 12:15:50 +0000
commitd3a3b1fad48b2892b54ed5e2caf5cf046225ba7e (patch)
tree1f20513a35c10037dcd49f7b3d86549f02de9eb0 /sys/scsi/scsi_base.c
parentFix SCSIDEBUG display of VPD inquiry data. (diff)
downloadwireguard-openbsd-d3a3b1fad48b2892b54ed5e2caf5cf046225ba7e.tar.xz
wireguard-openbsd-d3a3b1fad48b2892b54ed5e2caf5cf046225ba7e.zip
Fix SCSIDEBUG display of VPD inquiry data.
Remove extraneous whitespace in SCSIDEBUG read capacity display.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 175ed9c2256..740a1ef4eb3 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.237 2019/09/29 17:57:36 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.238 2019/11/09 12:15:50 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -905,11 +905,15 @@ scsi_inquire_vpd(struct scsi_link *link, void *buf, u_int buflen,
scsi_xs_put(xs);
#ifdef SCSIDEBUG
- bytes = _2btol(((struct scsi_vpd_hdr *)buf)->page_length);
sc_print_addr(link);
- printf("got %u bytes of VPD inquiry page %u data:\n", bytes,
- page);
- scsi_show_mem(buf, bytes);
+ if (error == 0) {
+ bytes = _2btol(((struct scsi_vpd_hdr *)buf)->page_length);
+ printf("got %u of %u bytes of VPD inquiry page %u data:\n", buflen,
+ bytes, page);
+ scsi_show_mem(buf, buflen);
+ } else {
+ printf("VPD inquiry page %u not available\n", page);
+ }
#endif /* SCSIDEBUG */
return (error);
}