svn commit: r297926 - head/sys/cam/scsi

Scott Long scottl at FreeBSD.org
Wed Apr 13 15:57:14 UTC 2016


Author: scottl
Date: Wed Apr 13 15:57:13 2016
New Revision: 297926
URL: https://svnweb.freebsd.org/changeset/base/297926

Log:
  Use scsi_cdb_sbuf() inside of scsi_command_string now that the temporary
  string storage is no longer needed.
  
  MFC after:	3 days
  Sponsored by:	Netflix

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==============================================================================
--- head/sys/cam/scsi/scsi_all.c	Wed Apr 13 15:43:11 2016	(r297925)
+++ head/sys/cam/scsi/scsi_all.c	Wed Apr 13 15:57:13 2016	(r297926)
@@ -3579,7 +3579,6 @@ scsi_command_string(struct cam_device *d
 #endif /* _KERNEL/!_KERNEL */
 {
 	struct scsi_inquiry_data *inq_data;
-	char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
 #ifdef _KERNEL
 	struct	  ccb_getdev *cgd;
 #endif /* _KERNEL */
@@ -3612,15 +3611,13 @@ scsi_command_string(struct cam_device *d
 #endif /* _KERNEL/!_KERNEL */
 
 	if ((csio->ccb_h.flags & CAM_CDB_POINTER) != 0) {
-		sbuf_printf(sb, "%s. CDB: %s", 
-			    scsi_op_desc(csio->cdb_io.cdb_ptr[0], inq_data),
-			    scsi_cdb_string(csio->cdb_io.cdb_ptr, cdb_str,
-					    sizeof(cdb_str)));
+		sbuf_printf(sb, "%s. CDB: ", 
+			    scsi_op_desc(csio->cdb_io.cdb_ptr[0], inq_data));
+		scsi_cdb_sbuf(csio->cdb_io.cdb_ptr, sb);
 	} else {
-		sbuf_printf(sb, "%s. CDB: %s",
-			    scsi_op_desc(csio->cdb_io.cdb_bytes[0], inq_data),
-			    scsi_cdb_string(csio->cdb_io.cdb_bytes, cdb_str,
-					    sizeof(cdb_str)));
+		sbuf_printf(sb, "%s. CDB: ",
+			    scsi_op_desc(csio->cdb_io.cdb_bytes[0], inq_data));
+		scsi_cdb_sbuf(csio->cdb_io.cdb_bytes, sb);
 	}
 
 #ifdef _KERNEL


More information about the svn-src-all mailing list