diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c index b7024a6d6097..8986230ac68a 100644 --- a/lib/libcam/camlib.c +++ b/lib/libcam/camlib.c @@ -102,7 +102,7 @@ cam_freeccb(union ccb *ccb) * /dev/foo0 * foo0 * nfoo0 - * + * * Some peripheral drivers create separate device nodes with 'n' prefix for * non-rewind operations. Currently only sa(4) tape driver has this feature. * We extract pure peripheral name as device name for this special case. @@ -194,7 +194,7 @@ cam_get_device(const char *path, char *dev_name, int devnamelen, int *unit) /* * At this point, if the last character of the string isn't a - * number, we know the user either didn't give us a device number, + * number, we know the user either didn't give us a device number, * or he gave us a device name/number format we don't recognize. */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { @@ -275,7 +275,7 @@ cam_open_btl(path_id_t path_id, target_id_t target_id, lun_id_t target_lun, int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -292,7 +292,7 @@ cam_open_btl(path_id_t path_id, target_id_t target_id, lun_id_t target_lun, ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc match buffer", func_name); close(fd); return(NULL); @@ -305,14 +305,14 @@ cam_open_btl(path_id_t path_id, target_id_t target_id, lun_id_t target_lun, ccb.cdm.patterns = (struct dev_match_pattern *)malloc( sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); close(fd); return(NULL); } ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; - match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; + match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; /* * We're looking for the passthrough device associated with this @@ -421,7 +421,7 @@ cam_lookup_pass(const char *dev_name, int unit, int flags, * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -435,7 +435,7 @@ cam_lookup_pass(const char *dev_name, int unit, int flags, ccb.cgdl.unit_number = unit; /* - * Attempt to get the passthrough device. This ioctl will fail if + * Attempt to get the passthrough device. This ioctl will fail if * the device name is null, if the device doesn't exist, or if the * passthrough driver isn't in the kernel. */ @@ -512,7 +512,7 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device, } device->fd = -1; malloced_device = 1; - } + } /* * If the user passed in a path, save it for him. @@ -551,7 +551,7 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device, * we don't have to set any fields. */ ccb.ccb_h.func_code = XPT_GDEVLIST; - + /* * We're only doing this to get some information on the device in * question. Otherwise, we'd have to pass in yet another @@ -611,7 +611,7 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device, goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); - bcopy(&ccb.cgd.inq_data, &device->inq_data, + bcopy(&ccb.cgd.inq_data, &device->inq_data, sizeof(struct scsi_inquiry_data)); device->serial_num_len = ccb.cgd.serial_num_len; bcopy(&ccb.cgd.serial_num, &device->serial_num, device->serial_num_len); @@ -719,7 +719,7 @@ cam_device_dup(struct cam_device *device) newdev = malloc(sizeof(struct cam_device)); if (newdev == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc CAM device structure", func_name); return(NULL); } diff --git a/lib/libcam/camlib.h b/lib/libcam/camlib.h index e505c77c43af..4fa6a67d8988 100644 --- a/lib/libcam/camlib.h +++ b/lib/libcam/camlib.h @@ -83,7 +83,7 @@ extern char cam_errbuf[]; struct cam_device { char device_path[MAXPATHLEN];/* - * Pathname of the device + * Pathname of the device * given by the user. This * may be null if the * user states the device @@ -98,15 +98,15 @@ struct cam_device { * Unit number given by * the user. */ - char device_name[DEV_IDLEN+1];/* - * Name of the device, - * e.g. 'pass' + char device_name[DEV_IDLEN+1];/* + * Name of the device, + * e.g. 'pass' */ u_int32_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 */ @@ -142,7 +142,7 @@ int cam_send_ccb(struct cam_device *device, union ccb *ccb); char * cam_path_string(struct cam_device *dev, char *str, int len); struct cam_device * cam_device_dup(struct cam_device *device); -void cam_device_copy(struct cam_device *src, +void cam_device_copy(struct cam_device *src, struct cam_device *dst); int cam_get_device(const char *path, char *dev_name, int devnamelen, int *unit);