Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Sep 2017 07:24:22 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323257 - head/sys/cam/scsi
Message-ID:  <201709070724.v877OM9W006675@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709070724.v877OM9W006675>