From 2bd282696a35ebf4e146542d62edfa8569a69e8a Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Wed, 22 Oct 2014 09:17:17 +0000 Subject: [PATCH] Whitespace fixes. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- usr.bin/iscsictl/Makefile | 2 +- usr.bin/iscsictl/iscsictl.c | 2 +- usr.sbin/ctladm/Makefile | 4 +-- usr.sbin/ctladm/ctladm.c | 54 ++++++++++++++++++------------------- usr.sbin/ctld/ctld.c | 12 ++++----- usr.sbin/ctld/kernel.c | 6 ++--- usr.sbin/ctld/keys.c | 2 +- usr.sbin/ctld/login.c | 6 ++--- usr.sbin/ctld/parse.y | 2 +- usr.sbin/iscsid/keys.c | 2 +- usr.sbin/iscsid/login.c | 6 ++--- 11 files changed, 49 insertions(+), 49 deletions(-) diff --git a/usr.bin/iscsictl/Makefile b/usr.bin/iscsictl/Makefile index a3b13bb18031..9351ed71ae2a 100644 --- a/usr.bin/iscsictl/Makefile +++ b/usr.bin/iscsictl/Makefile @@ -6,7 +6,7 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/../../sys/dev/iscsi MAN= iscsictl.8 -DPADD= ${LIBCAM} ${LIBUTIL} +DPADD= ${LIBCAM} ${LIBUTIL} LDADD= -lcam -lutil YFLAGS+= -v diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c index 383aeef88005..27467bbe185f 100644 --- a/usr.bin/iscsictl/iscsictl.c +++ b/usr.bin/iscsictl/iscsictl.c @@ -172,7 +172,7 @@ valid_iscsi_name(const char *name) for (i = strlen("iqn."); name[i] != '\0'; i++) { /* * XXX: We should verify UTF-8 normalisation, as defined - * by 3.2.6.2: iSCSI Name Encoding. + * by 3.2.6.2: iSCSI Name Encoding. */ if (isalnum(name[i])) continue; diff --git a/usr.sbin/ctladm/Makefile b/usr.sbin/ctladm/Makefile index 4d08f6e7ab02..a9f6bfd81780 100644 --- a/usr.sbin/ctladm/Makefile +++ b/usr.sbin/ctladm/Makefile @@ -2,12 +2,12 @@ PROG= ctladm SRCS= ctladm.c util.c ctl_util.c ctl_scsi_all.c -.PATH: ${.CURDIR}/../../sys/cam/ctl +.PATH: ${.CURDIR}/../../sys/cam/ctl SDIR= ${.CURDIR}/../../sys CFLAGS+= -I${SDIR} # This is necessary because of these warnings: # warning: cast increases required alignment of target type -# The solution is to either upgrade the compiler (preferred), or do void +# The solution is to either upgrade the compiler (preferred), or do void # pointer gymnastics to get around the warning. For now, disable the # warning instead of doing the void pointer workaround. .if ${MACHINE_CPUARCH} == "arm" diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 731c7d81160b..03f46c9f2cc4 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -148,7 +148,7 @@ typedef enum { CTLADM_ARG_ONOFFLINE = 0x0080000, CTLADM_ARG_ONESHOT = 0x0100000, CTLADM_ARG_TIMEOUT = 0x0200000, - CTLADM_ARG_INITIATOR = 0x0400000, + CTLADM_ARG_INITIATOR = 0x0400000, CTLADM_ARG_NOCOPY = 0x0800000, CTLADM_ARG_NEED_TL = 0x1000000 } ctladm_cmdargs; @@ -237,7 +237,7 @@ static int cctl_sync_cache(int fd, int target, int lun, int iid, int retries, int argc, char **argv, char *combinedopt); static int cctl_start_stop(int fd, int target, int lun, int iid, int retries, int start, int argc, char **argv, char *combinedopt); -static int cctl_mode_sense(int fd, int target, int lun, int iid, int retries, +static int cctl_mode_sense(int fd, int target, int lun, int iid, int retries, int argc, char **argv, char *combinedopt); static int cctl_read_capacity(int fd, int target, int lun, int iid, int retries, int argc, char **argv, @@ -258,7 +258,7 @@ static int cctl_req_sense(int fd, int target, int lun, int iid, int retries); static int cctl_persistent_reserve_in(int fd, int target, int lun, int initiator, int argc, char **argv, char *combinedopt, int retry_count); -static int cctl_persistent_reserve_out(int fd, int target, int lun, +static int cctl_persistent_reserve_out(int fd, int target, int lun, int initiator, int argc, char **argv, char *combinedopt, int retry_count); static int cctl_create_lun(int fd, int argc, char **argv, char *combinedopt); @@ -394,7 +394,7 @@ retry: cmd_latency = ts.tv_sec * 1000; if (ts.tv_nsec > 0) cmd_latency += ts.tv_nsec / 1000000; - + fprintf(stdout, "LUN %jd tag 0x%04x%s%s%s%s%s: %s. CDB: %s " "(%0.0Lf ms)\n", (intmax_t)entry->lun_num, entry->tag_num, @@ -622,7 +622,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) case 'o': if (port_mode != CCTL_PORT_MODE_NONE) goto bailout_badarg; - + if (strcasecmp(optarg, "on") == 0) port_mode = CCTL_PORT_MODE_ON; else if (strcasecmp(optarg, "off") == 0) @@ -1041,7 +1041,7 @@ static struct ctladm_opts cctl_err_patterns[] = { }; static int -cctl_error_inject(int fd, uint32_t target, uint32_t lun, int argc, char **argv, +cctl_error_inject(int fd, uint32_t target, uint32_t lun, int argc, char **argv, char *combinedopt) { int retval = 0; @@ -1206,12 +1206,12 @@ cctl_error_inject(int fd, uint32_t target, uint32_t lun, int argc, char **argv, if (fd_sense == 1) { ssize_t amt_read; int amt_to_read = sense_len; - u_int8_t *buf_ptr = (uint8_t *)&err_desc.custom_sense; + u_int8_t *buf_ptr = (uint8_t *)&err_desc.custom_sense; for (amt_read = 0; amt_to_read > 0; amt_read = read(STDIN_FILENO, buf_ptr, amt_to_read)) { if (amt_read == -1) { - warn("error reading sense data from stdin"); + warn("error reading sense data from stdin"); retval = 1; goto bailout; } @@ -1617,7 +1617,7 @@ cctl_startup_shutdown(int fd, int target, int lun, int iid, } if (ooa_info.status != CTL_OOA_SUCCESS) { - printf("%s CTL_CHECK_OOA returned status %d\n", + printf("%s CTL_CHECK_OOA returned status %d\n", scsi_path, ooa_info.status); continue; } @@ -1629,7 +1629,7 @@ cctl_startup_shutdown(int fd, int target, int lun, int iid, continue; } } - + ctl_scsi_start_stop(/*io*/ io, /*start*/(command == CTLADM_CMD_STARTUP) ? 1 : 0, @@ -1682,7 +1682,7 @@ cctl_sync_cache(int fd, int target, int lun, int iid, int retries, int retval; uint64_t our_lba = 0; uint32_t our_block_count = 0; - int reladr = 0, immed = 0; + int reladr = 0, immed = 0; int c; id.id = iid; @@ -1830,7 +1830,7 @@ bailout: } static int -cctl_mode_sense(int fd, int target, int lun, int iid, int retries, +cctl_mode_sense(int fd, int target, int lun, int iid, int retries, int argc, char **argv, char *combinedopt) { union ctl_io *io; @@ -2048,8 +2048,8 @@ bailout: } static int -cctl_read_capacity(int fd, int target, int lun, int iid, int retries, - int argc, char **argv, char *combinedopt) +cctl_read_capacity(int fd, int target, int lun, int iid, int retries, + int argc, char **argv, char *combinedopt) { union ctl_io *io; struct ctl_id id; @@ -2518,7 +2518,7 @@ cctl_tur(int fd, int target, int lun, int iid, int retries) } static int -cctl_get_inquiry(int fd, int target, int lun, int iid, int retries, +cctl_get_inquiry(int fd, int target, int lun, int iid, int retries, char *path_str, int path_len, struct scsi_inquiry_data *inq_data) { @@ -2669,7 +2669,7 @@ cctl_report_target_port_group(int fd, int target, int lun, int initiator) dataptr = (uint8_t *)malloc(datalen); if (dataptr == NULL) { warn("%s: can't allocate %d bytes", __func__, datalen); - retval = 1; + retval = 1; goto bailout; } @@ -2737,7 +2737,7 @@ cctl_inquiry_vpd_devid(int fd, int target, int lun, int initiator) dataptr = (uint8_t *)malloc(datalen); if (dataptr == NULL) { warn("%s: can't allocate %d bytes", __func__, datalen); - retval = 1; + retval = 1; goto bailout; } @@ -2784,7 +2784,7 @@ bailout: } static int -cctl_persistent_reserve_in(int fd, int target, int lun, int initiator, +cctl_persistent_reserve_in(int fd, int target, int lun, int initiator, int argc, char **argv, char *combinedopt, int retry_count) { @@ -2827,7 +2827,7 @@ cctl_persistent_reserve_in(int fd, int target, int lun, int initiator, dataptr = (uint8_t *)malloc(datalen); if (dataptr == NULL) { warn("%s: can't allocate %d bytes", __func__, datalen); - retval = 1; + retval = 1; goto bailout; } @@ -2890,8 +2890,8 @@ bailout: } static int -cctl_persistent_reserve_out(int fd, int target, int lun, int initiator, - int argc, char **argv, char *combinedopt, +cctl_persistent_reserve_out(int fd, int target, int lun, int initiator, + int argc, char **argv, char *combinedopt, int retry_count) { union ctl_io *io; @@ -3835,7 +3835,7 @@ struct cctl_lun_nv { }; /* - * Backend LUN information. + * Backend LUN information. */ struct cctl_lun { uint64_t lun_id; @@ -3951,7 +3951,7 @@ cctl_end_element(void *user_data, const char *name) } else if (strcmp(name, "lun") == 0) { devlist->cur_lun = NULL; } else if (strcmp(name, "ctllunlist") == 0) { - + /* Nothing. */ } else { struct cctl_lun_nv *nv; @@ -4216,7 +4216,7 @@ cctl_end_pelement(void *user_data, const char *name) } else if (strcmp(name, "targ_port") == 0) { portlist->cur_port = NULL; } else if (strcmp(name, "ctlportlist") == 0) { - + /* Nothing. */ } else { struct cctl_lun_nv *nv; @@ -4575,7 +4575,7 @@ main(int argc, char **argv) } if (cmdargs & CTLADM_ARG_NEED_TL) { - if ((argc < 3) + if ((argc < 3) || (!isdigit(argv[2][0]))) { warnx("option %s requires a target:lun argument", argv[1]); @@ -4802,12 +4802,12 @@ main(int argc, char **argv) retval = cctl_dump_structs(fd, cmdargs); break; case CTLADM_CMD_PRES_IN: - retval = cctl_persistent_reserve_in(fd, target, lun, initid, + retval = cctl_persistent_reserve_in(fd, target, lun, initid, argc, argv, combinedopt, retries); break; case CTLADM_CMD_PRES_OUT: - retval = cctl_persistent_reserve_out(fd, target, lun, initid, + retval = cctl_persistent_reserve_out(fd, target, lun, initid, argc, argv, combinedopt, retries); break; diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index e4c2eda0fcf7..a8a7a110cce6 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -255,7 +255,7 @@ auth_new_chap_mutual(struct auth_group *ag, const char *user, if (ag->ag_name != NULL) log_warnx("cannot mix \"chap-mutual\" authentication " "with other types for auth-group \"%s\"", - ag->ag_name); + ag->ag_name); else log_warnx("cannot mix \"chap-mutual\" authentication " "with other types for target \"%s\"", @@ -754,7 +754,7 @@ valid_iscsi_name(const char *name) for (i = strlen("iqn."); name[i] != '\0'; i++) { /* * XXX: We should verify UTF-8 normalisation, as defined - * by 3.2.6.2: iSCSI Name Encoding. + * by 3.2.6.2: iSCSI Name Encoding. */ if (isalnum(name[i])) continue; @@ -1281,10 +1281,10 @@ conf_apply(struct conf *oldconf, struct conf *newconf) /* * XXX: If target or lun removal fails, we should somehow "move" - * the old lun or target into newconf, so that subsequent - * conf_apply() would try to remove them again. That would - * be somewhat hairy, though, and lun deletion failures don't - * really happen, so leave it as it is for now. + * the old lun or target into newconf, so that subsequent + * conf_apply() would try to remove them again. That would + * be somewhat hairy, though, and lun deletion failures don't + * really happen, so leave it as it is for now. */ TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index 030ca1ef810b..219313f3ef01 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -105,7 +105,7 @@ struct cctl_lun_nv { }; /* - * Backend LUN information. + * Backend LUN information. */ struct cctl_lun { uint64_t lun_id; @@ -237,7 +237,7 @@ cctl_end_element(void *user_data, const char *name) } else if (strcmp(name, "lun") == 0) { devlist->cur_lun = NULL; } else if (strcmp(name, "ctllunlist") == 0) { - + /* Nothing. */ } else { struct cctl_lun_nv *nv; @@ -342,7 +342,7 @@ cctl_end_pelement(void *user_data, const char *name) } else if (strcmp(name, "targ_port") == 0) { devlist->cur_port = NULL; } else if (strcmp(name, "ctlportlist") == 0) { - + /* Nothing. */ } else { struct cctl_lun_nv *nv; diff --git a/usr.sbin/ctld/keys.c b/usr.sbin/ctld/keys.c index c2abe843893f..6a9ad02f1c94 100644 --- a/usr.sbin/ctld/keys.c +++ b/usr.sbin/ctld/keys.c @@ -116,7 +116,7 @@ keys_save(struct keys *keys, struct pdu *pdu) for (i = 0; i < KEYS_MAX; i++) { if (keys->keys_names[i] == NULL) break; - /* + /* * +1 for '=', +1 for '\0'. */ len += strlen(keys->keys_names[i]) + diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c index d6fd1ffa3c45..ee0038999bad 100644 --- a/usr.sbin/ctld/login.c +++ b/usr.sbin/ctld/login.c @@ -640,7 +640,7 @@ login_negotiate(struct connection *conn, struct pdu *request) if (conn->conn_target->t_alias != NULL) keys_add(response_keys, "TargetAlias", conn->conn_target->t_alias); - keys_add_int(response_keys, "TargetPortalGroupTag", + keys_add_int(response_keys, "TargetPortalGroupTag", conn->conn_portal->p_portal_group->pg_tag); } @@ -852,7 +852,7 @@ login(struct connection *conn) if (conn->conn_target->t_alias != NULL) keys_add(response_keys, "TargetAlias", conn->conn_target->t_alias); - keys_add_int(response_keys, "TargetPortalGroupTag", + keys_add_int(response_keys, "TargetPortalGroupTag", conn->conn_portal->p_portal_group->pg_tag); } keys_save(response_keys, response); @@ -903,7 +903,7 @@ login(struct connection *conn) if (conn->conn_target->t_alias != NULL) keys_add(response_keys, "TargetAlias", conn->conn_target->t_alias); - keys_add_int(response_keys, "TargetPortalGroupTag", + keys_add_int(response_keys, "TargetPortalGroupTag", conn->conn_portal->p_portal_group->pg_tag); } keys_save(response_keys, response); diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index 645201be94d1..3acd48009b85 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -625,7 +625,7 @@ lun_device_id: DEVICE_ID STR lun_option: OPTION STR STR { struct lun_option *clo; - + clo = lun_option_new(lun, $2, $3); free($2); free($3); diff --git a/usr.sbin/iscsid/keys.c b/usr.sbin/iscsid/keys.c index abf746a476d5..bab1ac9e0b65 100644 --- a/usr.sbin/iscsid/keys.c +++ b/usr.sbin/iscsid/keys.c @@ -117,7 +117,7 @@ keys_save(struct keys *keys, struct pdu *pdu) for (i = 0; i < KEYS_MAX; i++) { if (keys->keys_names[i] == NULL) break; - /* + /* * +1 for '=', +1 for '\0'. */ len += strlen(keys->keys_names[i]) + diff --git a/usr.sbin/iscsid/login.c b/usr.sbin/iscsid/login.c index 19ab844c0ff8..afe7ebbc6bfd 100644 --- a/usr.sbin/iscsid/login.c +++ b/usr.sbin/iscsid/login.c @@ -182,7 +182,7 @@ kernel_modify(const struct connection *conn, const char *target_address) * be much more complicated: we would need to keep "dependencies" * for sessions, so that, in case described in draft and using draft * terminology, we would have three sessions: one for discovery, - * one for initial target portal, and one for redirect portal. + * one for initial target portal, and one for redirect portal. * This would allow us to "backtrack" on connection failure, * as described in draft. */ @@ -756,8 +756,8 @@ login(struct connection *conn) * to parse things such as TargetAlias. * * XXX: This is somewhat ugly. We should have a way to apply - * all the keys to the session and use that by default - * instead of discarding them. + * all the keys to the session and use that by default + * instead of discarding them. */ if (strcmp(response_keys->keys_names[i], "AuthMethod") == 0) continue;