svn commit: r257382 - in head: lib/libcam sbin/camcontrol sys/cam

Nathan Whitehorn nwhitehorn at FreeBSD.org
Wed Oct 30 14:13:17 UTC 2013


Author: nwhitehorn
Date: Wed Oct 30 14:13:15 2013
New Revision: 257382
URL: http://svnweb.freebsd.org/changeset/base/257382

Log:
  printf() specifier updates to CAM to handle either 32-bit or 64-bit lun_id_t.
  
  MFC after:	2 weeks

Modified:
  head/lib/libcam/camlib.c
  head/sbin/camcontrol/camcontrol.c
  head/sys/cam/cam_xpt.c

Modified: head/lib/libcam/camlib.c
==============================================================================
--- head/lib/libcam/camlib.c	Wed Oct 30 14:04:47 2013	(r257381)
+++ head/lib/libcam/camlib.c	Wed Oct 30 14:13:15 2013	(r257382)
@@ -348,16 +348,16 @@ cam_open_btl(path_id_t path_id, target_i
 	if (ccb.cdm.status == CAM_DEV_MATCH_MORE) {
 		snprintf(cam_errbuf, CAM_ERRBUF_SIZE,
 			 "%s: CDM reported more than one"
-			 " passthrough device at %d:%d:%d!!\n",
-			 func_name, path_id, target_id, target_lun);
+			 " passthrough device at %d:%d:%jx!!\n",
+			 func_name, path_id, target_id, (uintmax_t)target_lun);
 		goto btl_bailout;
 	}
 
 	if (ccb.cdm.num_matches == 0) {
 		snprintf(cam_errbuf, CAM_ERRBUF_SIZE,
 			 "%s: no passthrough device found at"
-			 " %d:%d:%d", func_name, path_id, target_id,
-			 target_lun);
+			 " %d:%d:%jx", func_name, path_id, target_id,
+			 (uintmax_t)target_lun);
 		goto btl_bailout;
 	}
 
@@ -687,14 +687,14 @@ cam_path_string(struct cam_device *dev, 
 		return(str);
 	}
 
-	snprintf(str, len, "(%s%d:%s%d:%d:%d:%d): ",
+	snprintf(str, len, "(%s%d:%s%d:%d:%d:%jx): ",
 		 (dev->device_name[0] != '\0') ? dev->device_name : "pass",
 		 dev->dev_unit_num,
 		 (dev->sim_name[0] != '\0') ? dev->sim_name : "unknown",
 		 dev->sim_unit_number,
 		 dev->bus_id,
 		 dev->target_id,
-		 dev->target_lun);
+		 (uintmax_t)dev->target_lun);
 
 	return(str);
 }

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Wed Oct 30 14:04:47 2013	(r257381)
+++ head/sbin/camcontrol/camcontrol.c	Wed Oct 30 14:13:15 2013	(r257382)
@@ -566,11 +566,11 @@ getdevtree(void)
 				}
 
 				fprintf(stdout, "%-33s  at scbus%d "
-					"target %d lun %d (",
+					"target %d lun %jx (",
 					tmpstr,
 					dev_result->path_id,
 					dev_result->target_id,
-					dev_result->target_lun);
+					(uintmax_t)dev_result->target_lun);
 
 				need_close = 1;
 

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Wed Oct 30 14:04:47 2013	(r257381)
+++ head/sys/cam/cam_xpt.c	Wed Oct 30 14:13:15 2013	(r257382)
@@ -1020,14 +1020,14 @@ xpt_announce_periph(struct cam_periph *p
 	cam_periph_assert(periph, MA_OWNED);
 	periph->flags |= CAM_PERIPH_ANNOUNCED;
 
-	printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n",
+	printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n",
 	       periph->periph_name, periph->unit_number,
 	       path->bus->sim->sim_name,
 	       path->bus->sim->unit_number,
 	       path->bus->sim->bus_id,
 	       path->bus->path_id,
 	       path->target->target_id,
-	       path->device->lun_id);
+	       (uintmax_t)path->device->lun_id);
 	printf("%s%d: ", periph->periph_name, periph->unit_number);
 	if (path->device->protocol == PROTO_SCSI)
 		scsi_print_inquiry(&path->device->inq_data);
@@ -1073,14 +1073,14 @@ xpt_denounce_periph(struct cam_periph *p
 	struct	cam_path *path = periph->path;
 
 	cam_periph_assert(periph, MA_OWNED);
-	printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n",
+	printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n",
 	       periph->periph_name, periph->unit_number,
 	       path->bus->sim->sim_name,
 	       path->bus->sim->unit_number,
 	       path->bus->sim->bus_id,
 	       path->bus->path_id,
 	       path->target->target_id,
-	       path->device->lun_id);
+	       (uintmax_t)path->device->lun_id);
 	printf("%s%d: ", periph->periph_name, periph->unit_number);
 	if (path->device->protocol == PROTO_SCSI)
 		scsi_print_inquiry_short(&path->device->inq_data);
@@ -3647,7 +3647,7 @@ xpt_print_path(struct cam_path *path)
 			printf("X:");
 
 		if (path->device != NULL)
-			printf("%d): ", path->device->lun_id);
+			printf("%jx): ", (uintmax_t)path->device->lun_id);
 		else
 			printf("X): ");
 	}
@@ -3660,11 +3660,11 @@ xpt_print_device(struct cam_ed *device)
 	if (device == NULL)
 		printf("(nopath): ");
 	else {
-		printf("(noperiph:%s%d:%d:%d:%d): ", device->sim->sim_name,
+		printf("(noperiph:%s%d:%d:%d:%jx): ", device->sim->sim_name,
 		       device->sim->unit_number,
 		       device->sim->bus_id,
 		       device->target->target_id,
-		       device->lun_id);
+		       (uintmax_t)device->lun_id);
 	}
 }
 
@@ -3707,7 +3707,8 @@ xpt_path_string(struct cam_path *path, c
 			sbuf_printf(&sb, "X:");
 
 		if (path->device != NULL)
-			sbuf_printf(&sb, "%d): ", path->device->lun_id);
+			sbuf_printf(&sb, "%jx): ",
+			    (uintmax_t)path->device->lun_id);
 		else
 			sbuf_printf(&sb, "X): ");
 	}


More information about the svn-src-all mailing list