Clean up trailing whitespace in lib/libcam; no functional change

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-04-14 21:10:53 +00:00
parent fdff4951ca
commit fbcdfe1d5b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297999
2 changed files with 18 additions and 18 deletions

View file

@ -102,7 +102,7 @@ cam_freeccb(union ccb *ccb)
* /dev/foo0 * /dev/foo0
* foo0 * foo0
* nfoo0 * nfoo0
* *
* Some peripheral drivers create separate device nodes with 'n' prefix for * Some peripheral drivers create separate device nodes with 'n' prefix for
* non-rewind operations. Currently only sa(4) tape driver has this feature. * non-rewind operations. Currently only sa(4) tape driver has this feature.
* We extract pure peripheral name as device name for this special case. * 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 * 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. * or he gave us a device name/number format we don't recognize.
*/ */
if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { 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; int fd, bufsize;
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { 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, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE,
func_name, strerror(errno)); func_name, strerror(errno));
return(NULL); 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.match_buf_len = bufsize;
ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize);
if (ccb.cdm.matches == NULL) { 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); "%s: couldn't malloc match buffer", func_name);
close(fd); close(fd);
return(NULL); 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( ccb.cdm.patterns = (struct dev_match_pattern *)malloc(
sizeof(struct dev_match_pattern)); sizeof(struct dev_match_pattern));
if (ccb.cdm.patterns == NULL) { 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); "%s: couldn't malloc pattern buffer", func_name);
free(ccb.cdm.matches); free(ccb.cdm.matches);
close(fd); close(fd);
return(NULL); return(NULL);
} }
ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; 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 * 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. * passthrough device.
*/ */
if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { 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, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE,
func_name, strerror(errno)); func_name, strerror(errno));
return(NULL); return(NULL);
@ -435,7 +435,7 @@ cam_lookup_pass(const char *dev_name, int unit, int flags,
ccb.cgdl.unit_number = unit; 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 * the device name is null, if the device doesn't exist, or if the
* passthrough driver isn't in the kernel. * 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; device->fd = -1;
malloced_device = 1; malloced_device = 1;
} }
/* /*
* If the user passed in a path, save it for him. * 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. * we don't have to set any fields.
*/ */
ccb.ccb_h.func_code = XPT_GDEVLIST; ccb.ccb_h.func_code = XPT_GDEVLIST;
/* /*
* We're only doing this to get some information on the device in * We're only doing this to get some information on the device in
* question. Otherwise, we'd have to pass in yet another * 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; goto crod_bailout;
} }
device->pd_type = SID_TYPE(&ccb.cgd.inq_data); 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)); sizeof(struct scsi_inquiry_data));
device->serial_num_len = ccb.cgd.serial_num_len; device->serial_num_len = ccb.cgd.serial_num_len;
bcopy(&ccb.cgd.serial_num, &device->serial_num, device->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)); newdev = malloc(sizeof(struct cam_device));
if (newdev == NULL) { if (newdev == NULL) {
snprintf(cam_errbuf, CAM_ERRBUF_SIZE, snprintf(cam_errbuf, CAM_ERRBUF_SIZE,
"%s: couldn't malloc CAM device structure", func_name); "%s: couldn't malloc CAM device structure", func_name);
return(NULL); return(NULL);
} }

View file

@ -83,7 +83,7 @@ extern char cam_errbuf[];
struct cam_device { struct cam_device {
char device_path[MAXPATHLEN];/* char device_path[MAXPATHLEN];/*
* Pathname of the device * Pathname of the device
* given by the user. This * given by the user. This
* may be null if the * may be null if the
* user states the device * user states the device
@ -98,15 +98,15 @@ struct cam_device {
* Unit number given by * Unit number given by
* the user. * the user.
*/ */
char device_name[DEV_IDLEN+1];/* char device_name[DEV_IDLEN+1];/*
* Name of the device, * Name of the device,
* e.g. 'pass' * e.g. 'pass'
*/ */
u_int32_t dev_unit_num; /* Unit number of the passthrough u_int32_t dev_unit_num; /* Unit number of the passthrough
* device associated with this * device associated with this
* particular device. * particular device.
*/ */
char sim_name[SIM_IDLEN+1]; /* Controller name, e.g. 'ahc' */ char sim_name[SIM_IDLEN+1]; /* Controller name, e.g. 'ahc' */
u_int32_t sim_unit_number; /* Controller unit number */ u_int32_t sim_unit_number; /* Controller unit number */
u_int32_t bus_id; /* Controller bus 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, char * cam_path_string(struct cam_device *dev, char *str,
int len); int len);
struct cam_device * cam_device_dup(struct cam_device *device); 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); struct cam_device *dst);
int cam_get_device(const char *path, char *dev_name, int cam_get_device(const char *path, char *dev_name,
int devnamelen, int *unit); int devnamelen, int *unit);