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

Conrad Meyer cem at FreeBSD.org
Thu Sep 7 07:24:24 UTC 2017


Author: cem
Date: Thu Sep  7 07:24:22 2017
New Revision: 323257
URL: https://svnweb.freebsd.org/changeset/base/323257

Log:
  cam(4): Fix some warnings
  
  When bcopy is treated as memcpy/memmove, Clang produces warnings that the
  size argument doesn't match the type of the source.  This is true, it
  doesn't match; we're aliasing the source.
  
  Explicitly cast the source pointer to the expected type to remove the
  warning.
  
  No functional change.
  
  Sponsored by:	Dell EMC Isilon

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

Modified: head/sys/cam/scsi/scsi_all.c
==============================================================================
--- head/sys/cam/scsi/scsi_all.c	Thu Sep  7 05:41:13 2017	(r323256)
+++ head/sys/cam/scsi/scsi_all.c	Thu Sep  7 07:24:22 2017	(r323257)
@@ -5100,8 +5100,8 @@ scsi_sense_sbuf(struct cam_device *device, struct ccb_
 			 * errors on finicky architectures.  We don't
 			 * ensure that the sense data is pointer aligned.
 			 */
-			bcopy(&csio->sense_data, &sense, 
-			      sizeof(struct scsi_sense_data *));
+			bcopy((struct scsi_sense_data **)&csio->sense_data,
+			    &sense, sizeof(struct scsi_sense_data *));
 		}
 	} else {
 		/*
@@ -5225,8 +5225,8 @@ scsi_extract_sense_ccb(union ccb *ccb,
 		return (0);
 
 	if (ccb->ccb_h.flags & CAM_SENSE_PTR)
-		bcopy(&ccb->csio.sense_data, &sense_data,
-		    sizeof(struct scsi_sense_data *));
+		bcopy((struct scsi_sense_data **)&ccb->csio.sense_data,
+		    &sense_data, sizeof(struct scsi_sense_data *));
 	else
 		sense_data = &ccb->csio.sense_data;
 	scsi_extract_sense_len(sense_data,


More information about the svn-src-head mailing list