git: f9ffa1ef25cf - main - libcam: Migrate to modern uintXX_t from u_intXX_t

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 25 Jul 2023 04:26:35 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f9ffa1ef25cff69f3aa090752430b2b16d1dc7a6

commit f9ffa1ef25cff69f3aa090752430b2b16d1dc7a6
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-07-25 03:17:41 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-07-25 03:35:10 +0000

    libcam: Migrate to modern uintXX_t from u_intXX_t
    
    As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html
    move to the modern uintXX_t.
    
    MFC After:      3 days
    Sponsored by:   Netflix
---
 lib/libcam/camlib.h        | 34 +++++++++++++++++-----------------
 lib/libcam/scsi_cmdparse.c | 16 ++++++++--------
 lib/libcam/scsi_wrap.c     |  2 +-
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/lib/libcam/camlib.h b/lib/libcam/camlib.h
index 3ae775cd87f5..48710db13909 100644
--- a/lib/libcam/camlib.h
+++ b/lib/libcam/camlib.h
@@ -96,7 +96,7 @@ struct cam_device {
 						     * Device name given by
 						     * the user.
 						     */
-	u_int32_t	given_unit_number;	    /*
+	uint32_t	given_unit_number;	    /*
 						     * Unit number given by
 						     * the user.
 						     */
@@ -104,24 +104,24 @@ struct cam_device {
 						  * Name of the device,
 						  * e.g. 'pass'
 						  */
-	u_int32_t	dev_unit_num;	/* Unit number of the passthrough
+	uint32_t	dev_unit_num;	/* Unit number of the passthrough
 					 * device associated with this
 					 * particular device.
 					 */
 
 	char		sim_name[SIM_IDLEN+1]; /* Controller name, e.g. 'ahc' */
-	u_int32_t	sim_unit_number; /* Controller unit number */
-	u_int32_t	bus_id;		 /* Controller bus number */
+	uint32_t	sim_unit_number; /* Controller unit number */
+	uint32_t	bus_id;		 /* Controller bus number */
 	lun_id_t	target_lun;	 /* Logical Unit Number */
 	target_id_t	target_id;	 /* Target ID */
 	path_id_t	path_id;	 /* System SCSI bus number */
-	u_int16_t	pd_type;	 /* type of peripheral device */
+	uint16_t	pd_type;	 /* type of peripheral device */
 	struct scsi_inquiry_data inq_data;  /* SCSI Inquiry data */
-	u_int8_t	serial_num[252]; /* device serial number */
-	u_int8_t	serial_num_len;  /* length of the serial number */
-	u_int8_t	sync_period;	 /* Negotiated sync period */
-	u_int8_t	sync_offset;	 /* Negotiated sync offset */
-	u_int8_t	bus_width;	 /* Negotiated bus width */
+	uint8_t	serial_num[252]; /* device serial number */
+	uint8_t	serial_num_len;  /* length of the serial number */
+	uint8_t	sync_period;	 /* Negotiated sync period */
+	uint8_t	sync_offset;	 /* Negotiated sync offset */
+	uint8_t	bus_width;	 /* Negotiated bus width */
 	int		fd;		 /* file descriptor for device */
 };
 
@@ -157,22 +157,22 @@ int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...)
 int csio_decode_visit(struct ccb_scsiio *csio, const char *fmt,
 		      void (*arg_put)(void *, int, void *, int, char *),
 		      void *puthook);
-int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...)
+int buff_decode(uint8_t *buff, size_t len, const char *fmt, ...)
 		__printflike(3, 4);
-int buff_decode_visit(u_int8_t *buff, size_t len, const char *fmt,
+int buff_decode_visit(uint8_t *buff, size_t len, const char *fmt,
 		      void (*arg_put)(void *, int, void *, int, char *),
 		      void *puthook);
-int csio_build(struct ccb_scsiio *csio, u_int8_t *data_ptr,
-	       u_int32_t dxfer_len, u_int32_t flags, int retry_count,
+int csio_build(struct ccb_scsiio *csio, uint8_t *data_ptr,
+	       uint32_t dxfer_len, uint32_t flags, int retry_count,
 	       int timeout, const char *cmd_spec, ...);
-int csio_build_visit(struct ccb_scsiio *csio, u_int8_t *data_ptr,
-		     u_int32_t dxfer_len, u_int32_t flags, int retry_count,
+int csio_build_visit(struct ccb_scsiio *csio, uint8_t *data_ptr,
+		     uint32_t dxfer_len, uint32_t flags, int retry_count,
 		     int timeout, const char *cmd_spec,
 		     int (*arg_get)(void *hook, char *field_name),
 		     void *gethook);
 int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...)
 		__printflike(2, 3);
-int buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt,
+int buff_encode_visit(uint8_t *buff, size_t len, const char *fmt,
 		      int (*arg_get)(void *hook, char *field_name),
 		      void *gethook);
 int csio_encode_visit(struct ccb_scsiio *csio, const char *fmt,
diff --git a/lib/libcam/scsi_cmdparse.c b/lib/libcam/scsi_cmdparse.c
index b123d2747ca9..7da553d14397 100644
--- a/lib/libcam/scsi_cmdparse.c
+++ b/lib/libcam/scsi_cmdparse.c
@@ -103,7 +103,7 @@ __FBSDID("$FreeBSD$");
  */
 
 static int
-do_buff_decode(u_int8_t *buff, size_t len,
+do_buff_decode(uint8_t *buff, size_t len,
 	       void (*arg_put)(void *, int , void *, int, char *),
 	       void *puthook, const char *fmt, va_list *ap)
 {
@@ -701,7 +701,7 @@ csio_decode_visit(struct ccb_scsiio *csio, const char *fmt,
 }
 
 int
-buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...)
+buff_decode(uint8_t *buff, size_t len, const char *fmt, ...)
 {
 	va_list ap;
 	int retval;
@@ -716,7 +716,7 @@ buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...)
 }
 
 int
-buff_decode_visit(u_int8_t *buff, size_t len, const char *fmt,
+buff_decode_visit(uint8_t *buff, size_t len, const char *fmt,
 		  void (*arg_put)(void *, int, void *, int, char *),
 		  void *puthook)
 {
@@ -736,8 +736,8 @@ buff_decode_visit(u_int8_t *buff, size_t len, const char *fmt,
  * string describing the 
  */
 int
-csio_build(struct ccb_scsiio *csio, u_int8_t *data_ptr, u_int32_t dxfer_len,
-	   u_int32_t flags, int retry_count, int timeout, const char *cmd_spec,
+csio_build(struct ccb_scsiio *csio, uint8_t *data_ptr, uint32_t dxfer_len,
+	   uint32_t flags, int retry_count, int timeout, const char *cmd_spec,
 	   ...)
 {
 	size_t cmdlen;
@@ -773,8 +773,8 @@ done:
 }
 
 int
-csio_build_visit(struct ccb_scsiio *csio, u_int8_t *data_ptr,
-		 u_int32_t dxfer_len, u_int32_t flags, int retry_count,
+csio_build_visit(struct ccb_scsiio *csio, uint8_t *data_ptr,
+		 uint32_t dxfer_len, uint32_t flags, int retry_count,
 		 int timeout, const char *cmd_spec,
 		 int (*arg_get)(void *hook, char *field_name), void *gethook)
 {
@@ -831,7 +831,7 @@ csio_encode(struct ccb_scsiio *csio, const char *fmt, ...)
 }
 
 int
-buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt,
+buff_encode_visit(uint8_t *buff, size_t len, const char *fmt,
 		  int (*arg_get)(void *hook, char *field_name), void *gethook)
 {
 
diff --git a/lib/libcam/scsi_wrap.c b/lib/libcam/scsi_wrap.c
index 524d36955c17..069dfa7320b1 100644
--- a/lib/libcam/scsi_wrap.c
+++ b/lib/libcam/scsi_wrap.c
@@ -146,7 +146,7 @@ scsi_wrap_inquiry(struct cam_device *device, uint32_t page, uint32_t length)
 		     /*retries*/ 0,
 		     /*cbfcnp*/ NULL,
 		     /* tag_action */ MSG_SIMPLE_Q_TAG,
-		     /* inq_buf */ (u_int8_t *)buf,
+		     /* inq_buf */ (uint8_t *)buf,
 		     /* inq_len */ length,
 		     /* evpd */ 1,
 		     /* page_code */ page,