svn commit: r334945 - head/sys/dev/ocs_fc

Dimitry Andric dim at FreeBSD.org
Mon Jun 11 07:57:33 UTC 2018


Author: dim
Date: Mon Jun 11 07:57:32 2018
New Revision: 334945
URL: https://svnweb.freebsd.org/changeset/base/334945

Log:
  Fix build of ocs_fs with base gcc on i386
  
  Add a few intermediate casts to uintptr_t to suppress "cast to pointer
  from integer of different size" warnings from gcc.  Also remove a few
  incorrect casts.
  
  Reviewed by:	ram
  MFC after:	3 days
  Differential Revision: https://reviews.freebsd.org/D15747

Modified:
  head/sys/dev/ocs_fc/ocs_ioctl.c
  head/sys/dev/ocs_fc/ocs_sport.c

Modified: head/sys/dev/ocs_fc/ocs_ioctl.c
==============================================================================
--- head/sys/dev/ocs_fc/ocs_ioctl.c	Mon Jun 11 05:35:57 2018	(r334944)
+++ head/sys/dev/ocs_fc/ocs_ioctl.c	Mon Jun 11 07:57:32 2018	(r334945)
@@ -140,7 +140,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo
 			wrobj->host_buffer_descriptor[0].u.data.buffer_address_high = ocs_addr32_hi(dma->phys);
 
 			/* copy the data into the DMA buffer */
-			copyin((void *)mcmd->in_addr, dma->virt, mcmd->in_bytes);
+			copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes);
 		}
 			break;
 		case SLI4_OPC_COMMON_DELETE_OBJECT:
@@ -169,8 +169,8 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo
 			break;
 		default:
 			device_printf(ocs->dev, "%s: in=%p (%lld) out=%p (%lld)\n", __func__,
-					(void *)mcmd->in_addr, (unsigned long long)mcmd->in_bytes,
-					(void *)mcmd->out_addr, (unsigned long long)mcmd->out_bytes);
+					(void *)(uintptr_t)mcmd->in_addr, (unsigned long long)mcmd->in_bytes,
+					(void *)(uintptr_t)mcmd->out_addr, (unsigned long long)mcmd->out_bytes);
 			device_printf(ocs->dev, "%s: unknown (opc=%#x)\n", __func__,
 					req->opcode);
 			hexdump(mcmd, mcmd->size, NULL, 0);
@@ -184,7 +184,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo
 			return ENXIO;
 		}
 
-		copyin((void *)mcmd->in_addr, dma->virt, mcmd->in_bytes);
+		copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes);
 
 		sli_config->payload.mem.address_low  = ocs_addr32_lo(dma->phys);
 		sli_config->payload.mem.address_high = ocs_addr32_hi(dma->phys);
@@ -250,7 +250,7 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_
 
 	if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command
 	  		&& mcmd->out_bytes && dma.virt) {
-		copyout(dma.virt, (void *)mcmd->out_addr, mcmd->out_bytes);
+		copyout(dma.virt, (void *)(uintptr_t)mcmd->out_addr, mcmd->out_bytes);
 	}
 
 no_support:

Modified: head/sys/dev/ocs_fc/ocs_sport.c
==============================================================================
--- head/sys/dev/ocs_fc/ocs_sport.c	Mon Jun 11 05:35:57 2018	(r334944)
+++ head/sys/dev/ocs_fc/ocs_sport.c	Mon Jun 11 07:57:32 2018	(r334945)
@@ -781,7 +781,7 @@ __ocs_sport_attached(ocs_sm_ctx_t *ctx, ocs_sm_event_t
 	case OCS_EVT_ENTER: {
 		ocs_node_t *node;
 
-		ocs_log_debug(ocs, "[%s] SPORT attached WWPN %016llx WWNN %016llx \n", (unsigned long long)sport->display_name,
+		ocs_log_debug(ocs, "[%s] SPORT attached WWPN %016llx WWNN %016llx \n", sport->display_name,
 			sport->wwpn, sport->wwnn);
 		ocs_sport_lock(sport);
 			ocs_list_foreach(&sport->node_list, node) {
@@ -805,7 +805,7 @@ __ocs_sport_attached(ocs_sm_ctx_t *ctx, ocs_sm_event_t
 	}
 
 	case OCS_EVT_EXIT:
-		ocs_log_debug(ocs, "[%s] SPORT deattached WWPN %016llx WWNN %016llx \n", (unsigned long long)sport->display_name,
+		ocs_log_debug(ocs, "[%s] SPORT deattached WWPN %016llx WWNN %016llx \n", sport->display_name,
 			sport->wwpn, sport->wwnn);
 		if (sport->enable_ini) {
 			ocs_scsi_ini_del_sport(sport);


More information about the svn-src-head mailing list