svn commit: r307090 - projects/powerpcspe/sys/cam/ctl

Justin Hibbits jhibbits at FreeBSD.org
Wed Oct 12 03:03:45 UTC 2016


Author: jhibbits
Date: Wed Oct 12 03:03:43 2016
New Revision: 307090
URL: https://svnweb.freebsd.org/changeset/base/307090

Log:
  Cast through uintptr_t, which is language-safe for casting between pointers and
  integers.  This fixes ctl(4) module builds for PowerPC Book-E.

Modified:
  projects/powerpcspe/sys/cam/ctl/ctl_frontend_cam_sim.c
  projects/powerpcspe/sys/cam/ctl/scsi_ctl.c

Modified: projects/powerpcspe/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- projects/powerpcspe/sys/cam/ctl/ctl_frontend_cam_sim.c	Wed Oct 12 03:03:05 2016	(r307089)
+++ projects/powerpcspe/sys/cam/ctl/ctl_frontend_cam_sim.c	Wed Oct 12 03:03:43 2016	(r307090)
@@ -346,7 +346,7 @@ cfcs_datamove(union ctl_io *io)
 	case CAM_DATA_VADDR:
 		cam_sglist = &cam_sg_entry;
 		cam_sglist[0].ds_len = ccb->csio.dxfer_len;
-		cam_sglist[0].ds_addr = (bus_addr_t)ccb->csio.data_ptr;
+		cam_sglist[0].ds_addr = (uintptr_t)ccb->csio.data_ptr;
 		cam_sg_count = 1;
 		cam_sg_start = 0;
 		cam_sg_offset = io->scsiio.kern_rel_offset;
@@ -375,7 +375,7 @@ cfcs_datamove(union ctl_io *io)
 		len_to_copy = MIN(cam_sglist[i].ds_len - cam_watermark,
 				  ctl_sglist[j].len - ctl_watermark);
 
-		cam_ptr = (uint8_t *)cam_sglist[i].ds_addr;
+		cam_ptr = (uint8_t *)(uintptr_t)cam_sglist[i].ds_addr;
 		cam_ptr = cam_ptr + cam_watermark;
 		if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) {
 			/*

Modified: projects/powerpcspe/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- projects/powerpcspe/sys/cam/ctl/scsi_ctl.c	Wed Oct 12 03:03:05 2016	(r307089)
+++ projects/powerpcspe/sys/cam/ctl/scsi_ctl.c	Wed Oct 12 03:03:43 2016	(r307090)
@@ -741,7 +741,7 @@ ctlfedata(struct ctlfe_lun_softc *softc,
 		cam_sglist = cmd_info->cam_sglist;
 		*dxfer_len = 0;
 		for (i = 0; i < io->scsiio.kern_sg_entries - idx; i++) {
-			cam_sglist[i].ds_addr = (bus_addr_t)ctl_sglist[i + idx].addr + off;
+			cam_sglist[i].ds_addr = (uintptr_t)ctl_sglist[i + idx].addr + off;
 			if (ctl_sglist[i + idx].len - off <= bus_softc->maxio - *dxfer_len) {
 				cam_sglist[i].ds_len = ctl_sglist[idx + i].len - off;
 				*dxfer_len += cam_sglist[i].ds_len;


More information about the svn-src-projects mailing list