scripts/check_format.sh: check spaces in comments

Fix up all existing spacing errors in comments and add an automated
check for patterns like /*comment*/.

Change-Id: I28f61c93612dc0f8aed66bd509da78e91ea9737e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2017-04-24 11:14:41 -07:00
parent 9aaccfe3d7
commit 6b91943209
29 changed files with 102 additions and 88 deletions

View File

@ -388,7 +388,7 @@ parse_args(int argc, char **argv)
{ {
int op; int op;
/* default value*/ /* default value */
g_time_in_sec = 0; g_time_in_sec = 0;
while ((op = getopt(argc, argv, "i:n:r:t:")) != -1) { while ((op = getopt(argc, argv, "i:n:r:t:")) != -1) {

View File

@ -318,7 +318,7 @@ print_uint128_dec(uint64_t *v)
} }
} }
/* The len should be <= 8.*/ /* The len should be <= 8. */
static void static void
print_uint_var_dec(uint8_t *array, unsigned int len) print_uint_var_dec(uint8_t *array, unsigned int len)
{ {

View File

@ -862,7 +862,7 @@ parse_args(int argc, char **argv)
int op; int op;
bool mix_specified = false; bool mix_specified = false;
/* default value*/ /* default value */
g_queue_depth = 0; g_queue_depth = 0;
g_io_size_bytes = 0; g_io_size_bytes = 0;
workload_type = NULL; workload_type = NULL;

View File

@ -289,10 +289,10 @@ struct spdk_bdev_io {
*/ */
bool in_submit_request; bool in_submit_request;
/** Used in virtual device (e.g., RAID), indicates its parent spdk_bdev_io **/ /** Used in virtual device (e.g., RAID), indicates its parent spdk_bdev_io */
struct spdk_bdev_io *parent; struct spdk_bdev_io *parent;
/** Used in virtual device (e.g., RAID) for storing multiple child device I/Os **/ /** Used in virtual device (e.g., RAID) for storing multiple child device I/Os */
TAILQ_HEAD(child_io, spdk_bdev_io) child_io; TAILQ_HEAD(child_io, spdk_bdev_io) child_io;
/** Member used for linking child I/Os together. */ /** Member used for linking child I/Os together. */

View File

@ -1176,7 +1176,7 @@ _spdk_bs_load_used_clusters_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserr
/* The length of the mask (in bits) must not be greater than the length of the buffer (converted to bits) */ /* The length of the mask (in bits) must not be greater than the length of the buffer (converted to bits) */
assert(ctx->mask->length <= (ctx->super->used_cluster_mask_len * sizeof( assert(ctx->mask->length <= (ctx->super->used_cluster_mask_len * sizeof(
struct spdk_blob_md_page) * 8)); struct spdk_blob_md_page) * 8));
/* The length of the mask must be exactly equal to the total number of clusters*/ /* The length of the mask must be exactly equal to the total number of clusters */
assert(ctx->mask->length == ctx->bs->total_clusters); assert(ctx->mask->length == ctx->bs->total_clusters);
rc = spdk_bit_array_resize(&ctx->bs->used_clusters, ctx->bs->total_clusters); rc = spdk_bit_array_resize(&ctx->bs->used_clusters, ctx->bs->total_clusters);

View File

@ -287,7 +287,7 @@ copy_engine_ioat_init(void)
return 0; return 0;
} }
/*Init the whitelist*/ /* Init the whitelist */
for (i = 0; i < IOAT_MAX_CHANNELS; i++) { for (i = 0; i < IOAT_MAX_CHANNELS; i++) {
pci_bdf = spdk_conf_section_get_nmval(sp, "Whitelist", i, 0); pci_bdf = spdk_conf_section_get_nmval(sp, "Whitelist", i, 0);
if (!pci_bdf) if (!pci_bdf)

View File

@ -330,7 +330,7 @@ spdk_pci_device_get_serial_number(struct spdk_pci_device *dev, char *sn, size_t
while (1) { while (1) {
if ((header & 0x0000ffff) == PCI_EXT_CAP_ID_SN) { if ((header & 0x0000ffff) == PCI_EXT_CAP_ID_SN) {
if (pos) { if (pos) {
/*skip the header*/ /* skip the header */
pos += 4; pos += 4;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
err = spdk_pci_device_cfg_read32(dev, &buf[i], pos + 4 * i); err = spdk_pci_device_cfg_read32(dev, &buf[i], pos + 4 * i);
@ -342,7 +342,7 @@ spdk_pci_device_get_serial_number(struct spdk_pci_device *dev, char *sn, size_t
} }
} }
pos = (header >> 20) & 0xffc; pos = (header >> 20) & 0xffc;
/*0 if no other items exist*/ /* 0 if no other items exist */
if (pos < PCI_CFG_SIZE) if (pos < PCI_CFG_SIZE)
return -1; return -1;
err = spdk_pci_device_cfg_read32(dev, &header, pos); err = spdk_pci_device_cfg_read32(dev, &header, pos);

View File

@ -152,7 +152,7 @@ struct spdk_iscsi_conn {
uint32_t StatSN; uint32_t StatSN;
uint32_t exp_statsn; uint32_t exp_statsn;
uint32_t ttt; /* target transfer tag*/ uint32_t ttt; /* target transfer tag */
char *partial_text_parameter; char *partial_text_parameter;
STAILQ_ENTRY(spdk_iscsi_conn) link; STAILQ_ENTRY(spdk_iscsi_conn) link;

View File

@ -2151,13 +2151,13 @@ spdk_iscsi_op_login_rsp_handle(struct spdk_iscsi_conn *conn,
rsp_pdu->data_segment_len = rc; rsp_pdu->data_segment_len = rc;
SPDK_TRACEDUMP(SPDK_TRACE_DEBUG, "Negotiated Params", rsp_pdu->data, rc); SPDK_TRACEDUMP(SPDK_TRACE_DEBUG, "Negotiated Params", rsp_pdu->data, rc);
/* handle the CSG bit case*/ /* handle the CSG bit case */
rc = spdk_iscsi_op_login_rsp_handle_csg_bit(conn, rsp_pdu, params, rc = spdk_iscsi_op_login_rsp_handle_csg_bit(conn, rsp_pdu, params,
alloc_len); alloc_len);
if (rc < 0) if (rc < 0)
return rc; return rc;
/*handle the T bit case*/ /* handle the T bit case */
if (ISCSI_BHS_LOGIN_GET_TBIT(rsph->flags)) if (ISCSI_BHS_LOGIN_GET_TBIT(rsph->flags))
rc = spdk_iscsi_op_login_rsp_handle_t_bit(conn, rsp_pdu); rc = spdk_iscsi_op_login_rsp_handle_t_bit(conn, rsp_pdu);
@ -2188,7 +2188,7 @@ spdk_iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
return rc; return rc;
} }
/*For other values, we need to directly return*/ /* For other values, we need to directly return */
if (rc < 0) { if (rc < 0) {
spdk_put_pdu(rsp_pdu); spdk_put_pdu(rsp_pdu);
return rc; return rc;
@ -2994,7 +2994,7 @@ spdk_iscsi_op_scsi(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
return SPDK_ISCSI_CONNECTION_FATAL; return SPDK_ISCSI_CONNECTION_FATAL;
} }
/* check the ImmediateData and also pdu->data_segment_len*/ /* check the ImmediateData and also pdu->data_segment_len */
if ((!conn->sess->ImmediateData && (pdu->data_segment_len > 0)) || if ((!conn->sess->ImmediateData && (pdu->data_segment_len > 0)) ||
(pdu->data_segment_len > conn->sess->FirstBurstLength)) { (pdu->data_segment_len > conn->sess->FirstBurstLength)) {
spdk_iscsi_task_put(task); spdk_iscsi_task_put(task);
@ -3625,7 +3625,7 @@ void spdk_clear_all_transfer_task(struct spdk_iscsi_conn *conn,
spdk_del_connection_queued_task(&conn->queued_r2t_tasks, lun); spdk_del_connection_queued_task(&conn->queued_r2t_tasks, lun);
} }
/* This function is used to hanlde the r2t snack*/ /* This function is used to handle the r2t snack */
static int static int
spdk_iscsi_handle_r2t_snack(struct spdk_iscsi_conn *conn, spdk_iscsi_handle_r2t_snack(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task, struct spdk_iscsi_task *task,
@ -3667,7 +3667,7 @@ spdk_iscsi_handle_r2t_snack(struct spdk_iscsi_conn *conn,
return 0; return 0;
} }
/* This function is used to recover the data in packet*/ /* This function is used to recover the data in packet */
static int static int
spdk_iscsi_handle_recovery_datain(struct spdk_iscsi_conn *conn, spdk_iscsi_handle_recovery_datain(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task, struct spdk_iscsi_task *task,
@ -3722,7 +3722,7 @@ spdk_iscsi_handle_recovery_datain(struct spdk_iscsi_conn *conn,
return 0; return 0;
} }
/* This function is used to handle the status snack*/ /* This function is used to handle the status snack */
static int static int
spdk_iscsi_handle_status_snack(struct spdk_iscsi_conn *conn, spdk_iscsi_handle_status_snack(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_pdu *pdu) struct spdk_iscsi_pdu *pdu)
@ -3779,7 +3779,7 @@ spdk_iscsi_handle_status_snack(struct spdk_iscsi_conn *conn,
return 0; return 0;
} }
/*This function is used to handle the data ack snack*/ /* This function is used to handle the data ack snack */
static int static int
spdk_iscsi_handle_data_ack(struct spdk_iscsi_conn *conn, spdk_iscsi_handle_data_ack(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_pdu *pdu) struct spdk_iscsi_pdu *pdu)
@ -3931,7 +3931,7 @@ spdk_iscsi_send_r2t_recovery(struct spdk_iscsi_conn *conn,
return 0; return 0;
} }
/*This function is used to handle the snack request from the initiator*/ /* This function is used to handle the snack request from the initiator */
static int static int
spdk_iscsi_op_snack(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) spdk_iscsi_op_snack(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
{ {
@ -4009,7 +4009,7 @@ spdk_iscsi_op_snack(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
return rc; return rc;
} }
/*This fucntion is used to refree the pdu when it is acknowledged*/ /* This fucntion is used to refree the pdu when it is acknowledged */
static void static void
spdk_remove_acked_pdu(struct spdk_iscsi_conn *conn, spdk_remove_acked_pdu(struct spdk_iscsi_conn *conn,
uint32_t ExpStatSN) uint32_t ExpStatSN)
@ -4173,7 +4173,7 @@ spdk_iscsi_send_r2t(struct spdk_iscsi_conn *conn,
to_be32(&rsph->r2t_sn, *R2TSN); to_be32(&rsph->r2t_sn, *R2TSN);
*R2TSN += 1; *R2TSN += 1;
task->r2t_datasn = 0; /*next expected datasn to ack*/ task->r2t_datasn = 0; /* next expected datasn to ack */
to_be32(&rsph->buffer_offset, (uint32_t)offset); to_be32(&rsph->buffer_offset, (uint32_t)offset);
to_be32(&rsph->desired_xfer_len, (uint32_t)len); to_be32(&rsph->desired_xfer_len, (uint32_t)len);

View File

@ -590,10 +590,10 @@ spdk_iscsi_special_param_construction(struct spdk_iscsi_conn *conn,
} }
/** /**
* spdk_iscsi_construct_data_from_param: * spdk_iscsi_construct_data_from_param:
* To construct the data which will be returned to the initiator * To construct the data which will be returned to the initiator
* return: length of the negotiated data, -1 inidicates error; * return: length of the negotiated data, -1 inidicates error;
*/ */
static int static int
spdk_iscsi_construct_data_from_param(struct iscsi_param *param, char *new_val, spdk_iscsi_construct_data_from_param(struct iscsi_param *param, char *new_val,
char *data, int alloc_len, int total) char *data, int alloc_len, int total)
@ -619,10 +619,10 @@ spdk_iscsi_construct_data_from_param(struct iscsi_param *param, char *new_val,
} }
/** /**
* To negotiate param with * To negotiate param with
* type = ISPT_LIST * type = ISPT_LIST
return: the negotiated value of the key * return: the negotiated value of the key
*/ */
static char *spdk_iscsi_negotiate_param_list(int *add_param_value, static char *spdk_iscsi_negotiate_param_list(int *add_param_value,
struct iscsi_param *param, struct iscsi_param *param,
char *valid_list, char *in_val, char *valid_list, char *in_val,
@ -668,10 +668,10 @@ static char *spdk_iscsi_negotiate_param_list(int *add_param_value,
} }
/** /**
* To negotiate param with * To negotiate param with
* type = ISPT_NUMERICAL_MIN/MAX, ISPT_NUMERICAL_DECLARATIVE * type = ISPT_NUMERICAL_MIN/MAX, ISPT_NUMERICAL_DECLARATIVE
return: the negotiated value of the key * return: the negotiated value of the key
*/ */
static char *spdk_iscsi_negotiate_param_numerical(int *add_param_value, static char *spdk_iscsi_negotiate_param_numerical(int *add_param_value,
struct iscsi_param *param, struct iscsi_param *param,
char *valid_list, char *in_val, char *valid_list, char *in_val,
@ -723,10 +723,10 @@ static char *spdk_iscsi_negotiate_param_numerical(int *add_param_value,
} }
/** /**
* To negotiate param with * To negotiate param with
* type = ISPT_BOOLEAN_OR, ISPT_BOOLEAN_AND * type = ISPT_BOOLEAN_OR, ISPT_BOOLEAN_AND
return: the negotiated value of the key * return: the negotiated value of the key
*/ */
static char *spdk_iscsi_negotiate_param_boolean(int *add_param_value, static char *spdk_iscsi_negotiate_param_boolean(int *add_param_value,
struct iscsi_param *param, struct iscsi_param *param,
char *in_val, char *cur_val, char *in_val, char *cur_val,
@ -759,7 +759,7 @@ static char *spdk_iscsi_negotiate_param_boolean(int *add_param_value,
/** /**
* The entry function to handle each type of the param * The entry function to handle each type of the param
* return value: the new negotiated value * return value: the new negotiated value
*/ */
static char * static char *
spdk_iscsi_negotiate_param_all(int *add_param_value, struct iscsi_param *param, spdk_iscsi_negotiate_param_all(int *add_param_value, struct iscsi_param *param,
char *valid_list, char *in_val, char *cur_val) char *valid_list, char *in_val, char *cur_val)
@ -811,7 +811,7 @@ spdk_iscsi_negotiate_param_all(int *add_param_value, struct iscsi_param *param,
/** /**
* This function is used to judge whether the param is in session's params or * This function is used to judge whether the param is in session's params or
* connection's params * connection's params
*/ */
static int static int
spdk_iscsi_negotiate_param_init(struct spdk_iscsi_conn *conn, spdk_iscsi_negotiate_param_init(struct spdk_iscsi_conn *conn,
struct iscsi_param **cur_param_p, struct iscsi_param **cur_param_p,
@ -928,13 +928,13 @@ spdk_iscsi_negotiate_params(struct spdk_iscsi_conn *conn,
} }
/* To adjust the location of FirstBurstLength location and put it to /* To adjust the location of FirstBurstLength location and put it to
* the end, then we can always firstly determine the MaxBurstLength * the end, then we can always firstly determine the MaxBurstLength
*/ */
param = spdk_iscsi_param_find(params, "MaxBurstLength"); param = spdk_iscsi_param_find(params, "MaxBurstLength");
if (param != NULL) { if (param != NULL) {
param = spdk_iscsi_param_find(params, "FirstBurstLength"); param = spdk_iscsi_param_find(params, "FirstBurstLength");
/*check the existence of FirstBurstLength*/ /* check the existence of FirstBurstLength */
if (param != NULL) { if (param != NULL) {
FirstBurstLength_flag = true; FirstBurstLength_flag = true;
if (param->next != NULL) { if (param->next != NULL) {

View File

@ -68,7 +68,7 @@ struct spdk_iscsi_task {
*/ */
uint32_t next_r2t_offset; uint32_t next_r2t_offset;
uint32_t R2TSN; uint32_t R2TSN;
uint32_t r2t_datasn; /* record next datasn for a r2tsn*/ uint32_t r2t_datasn; /* record next datasn for a r2tsn */
uint32_t acked_r2tsn; /* next r2tsn to be acked */ uint32_t acked_r2tsn; /* next r2tsn to be acked */
uint32_t datain_datasn; uint32_t datain_datasn;
uint32_t acked_data_sn; /* next expected datain datasn */ uint32_t acked_data_sn; /* next expected datain datasn */

View File

@ -388,7 +388,7 @@ static int netlink_addr_msg(uint32_t ifc_idx, uint32_t ip_address, uint32_t crea
/* setup the service header (struct rtmsg). */ /* setup the service header (struct rtmsg). */
req.r.ifa_family = AF_INET; req.r.ifa_family = AF_INET;
req.r.ifa_prefixlen = 32; /*hardcoded*/ req.r.ifa_prefixlen = 32; /* hardcoded */
req.r.ifa_flags = IFA_F_PERMANENT | IFA_F_SECONDARY; req.r.ifa_flags = IFA_F_PERMANENT | IFA_F_SECONDARY;
req.r.ifa_index = ifc_idx; req.r.ifa_index = ifc_idx;
req.r.ifa_scope = 0; req.r.ifa_scope = 0;

View File

@ -213,13 +213,13 @@ nvmf_direct_ctrlr_process_admin_cmd(struct spdk_nvmf_request *req)
case SPDK_NVME_OPC_KEEP_ALIVE: case SPDK_NVME_OPC_KEEP_ALIVE:
SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n"); SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n");
/* /*
To handle keep alive just clear or reset the * To handle keep alive just clear or reset the
session based keep alive duration counter. * session based keep alive duration counter.
When added, a separate timer based process * When added, a separate timer based process
will monitor if the time since last recorded * will monitor if the time since last recorded
keep alive has exceeded the max duration and * keep alive has exceeded the max duration and
take appropriate action. * take appropriate action.
*/ */
//session->keep_alive_timestamp = ; //session->keep_alive_timestamp = ;
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE; return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;

View File

@ -345,13 +345,13 @@ nvmf_virtual_ctrlr_process_admin_cmd(struct spdk_nvmf_request *req)
case SPDK_NVME_OPC_KEEP_ALIVE: case SPDK_NVME_OPC_KEEP_ALIVE:
SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n"); SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n");
/* /*
To handle keep alive just clear or reset the * To handle keep alive just clear or reset the
session based keep alive duration counter. * session based keep alive duration counter.
When added, a separate timer based process * When added, a separate timer based process
will monitor if the time since last recorded * will monitor if the time since last recorded
keep alive has exceeded the max duration and * keep alive has exceeded the max duration and
take appropriate action. * take appropriate action.
*/ */
//session->keep_alive_timestamp = ; //session->keep_alive_timestamp = ;
return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE; return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;

View File

@ -281,7 +281,7 @@ static void spdk_scsi_lun_hot_remove(void *remove_ctx)
lun->lcore, 0); lun->lcore, 0);
} }
/*! /**
\brief Constructs a new spdk_scsi_lun object based on the provided parameters. \brief Constructs a new spdk_scsi_lun object based on the provided parameters.

View File

@ -415,7 +415,7 @@ spdk_bdev_scsi_inquiry(struct spdk_bdev *bdev, struct spdk_scsi_task *task,
/* MLUS(7) MODE PAGE POLICY(1-0) */ /* MLUS(7) MODE PAGE POLICY(1-0) */
/* MLUS own copy */ /* MLUS own copy */
/* Shared MODE PAGE policy*/ /* Shared MODE PAGE policy */
pdesc->policy = 0; pdesc->policy = 0;
/* Reserved */ /* Reserved */
pdesc->reserved = 0; pdesc->reserved = 0;

View File

@ -215,7 +215,7 @@ spdk_trace_register_owner(uint8_t type, char id_prefix)
/* 'owner' has 256 entries and since 'type' is a uint8_t, it /* 'owner' has 256 entries and since 'type' is a uint8_t, it
* can't overrun the array. * can't overrun the array.
*/ */
owner = &g_trace_histories->owner[type]; owner = &g_trace_histories->owner[type];
assert(owner->type == 0); assert(owner->type == 0);
@ -232,7 +232,7 @@ spdk_trace_register_object(uint8_t type, char id_prefix)
/* 'object' has 256 entries and since 'type' is a uint8_t, it /* 'object' has 256 entries and since 'type' is a uint8_t, it
* can't overrun the array. * can't overrun the array.
*/ */
object = &g_trace_histories->object[type]; object = &g_trace_histories->object[type];
assert(object->type == 0); assert(object->type == 0);

View File

@ -43,7 +43,7 @@ typedef void (*fd_cb)(int fd, void *dat, int *remove);
struct fdentry { struct fdentry {
int fd; /* -1 indicates this entry is empty */ int fd; /* -1 indicates this entry is empty */
fd_cb rcb; /* callback when this fd is readable. */ fd_cb rcb; /* callback when this fd is readable. */
fd_cb wcb; /* callback when this fd is writeable.*/ fd_cb wcb; /* callback when this fd is writeable. */
void *dat; /* fd context */ void *dat; /* fd context */
int busy; /* whether this entry is being used in cb. */ int busy; /* whether this entry is being used in cb. */
}; };

View File

@ -302,7 +302,7 @@ get_scsi_lun(struct spdk_scsi_dev *scsi_dev, const __u8 *lun)
{ {
uint16_t lun_id = (((uint16_t)lun[2] << 8) | lun[3]) & 0x3FFF; uint16_t lun_id = (((uint16_t)lun[2] << 8) | lun[3]) & 0x3FFF;
/* For now only one LUN per controller is allowed so no need to search LUN IDs*/ /* For now only one LUN per controller is allowed so no need to search LUN IDs */
return likely(scsi_dev != NULL && lun_id < scsi_dev->maxlun) ? scsi_dev->lun[lun_id] : NULL; return likely(scsi_dev != NULL && lun_id < scsi_dev->maxlun) ? scsi_dev->lun[lun_id] : NULL;
} }

View File

@ -36,6 +36,20 @@ else
echo "You do not have astyle installed so your code style is not being checked!" echo "You do not have astyle installed so your code style is not being checked!"
fi fi
echo -n "Checking comment style..."
git grep -e '/[*][^ *-]' -- '*.[ch]' > comment.log || true
git grep -e '[^ ][*]/' -- '*.[ch]' >> comment.log || true
if [ -s comment.log ]; then
echo " Incorrect comment formatting detected"
cat comment.log
rc=1
else
echo " OK"
fi
rm -f comment.log
echo -n "Checking blank lines at end of file..." echo -n "Checking blank lines at end of file..."
if ! git grep -I -l -e . -z | \ if ! git grep -I -l -e . -z | \

View File

@ -509,7 +509,7 @@ main(int argc, char **argv)
int op; int op;
bool mix_specified; bool mix_specified;
/* default value*/ /* default value */
config_file = NULL; config_file = NULL;
g_queue_depth = 0; g_queue_depth = 0;
g_io_size = 0; g_io_size = 0;
@ -660,7 +660,7 @@ main(int argc, char **argv)
g_zcopy = false; g_zcopy = false;
} }
optind = 1; /*reset the optind */ optind = 1; /* reset the optind */
rte_set_log_level(RTE_LOG_ERR); rte_set_log_level(RTE_LOG_ERR);

View File

@ -148,7 +148,7 @@ main(int argc, char **argv)
exit(1); exit(1);
} }
optind = 1; /*reset the optind */ optind = 1; /* reset the optind */
spdk_app_init(&opts); spdk_app_init(&opts);

View File

@ -116,7 +116,7 @@ burst_length_param_negotation(int FirstBurstLength, int MaxBurstLength,
rc = spdk_iscsi_conn_params_init(&conn.params); rc = spdk_iscsi_conn_params_init(&conn.params);
CU_ASSERT(rc == 0); CU_ASSERT(rc == 0);
/* construct the data*/ /* construct the data */
len = snprintf(data + total, 8192 - total, "%s=%d", len = snprintf(data + total, 8192 - total, "%s=%d",
"FirstBurstLength", FirstBurstLength); "FirstBurstLength", FirstBurstLength);
total += len + 1; total += len + 1;
@ -249,7 +249,7 @@ parse_valid_test(void)
CU_ASSERT(rc == 0); CU_ASSERT(rc == 0);
free(data); free(data);
/* partial parameter: value is partial*/ /* partial parameter: value is partial */
PARSE("C=AAA\0D=B", true, &partial_parameter); PARSE("C=AAA\0D=B", true, &partial_parameter);
SPDK_CU_ASSERT_FATAL(partial_parameter != NULL); SPDK_CU_ASSERT_FATAL(partial_parameter != NULL);
CU_ASSERT_STRING_EQUAL(partial_parameter, "D=B"); CU_ASSERT_STRING_EQUAL(partial_parameter, "D=B");
@ -262,7 +262,7 @@ parse_valid_test(void)
EXPECT_VAL("E", "UUUU"); EXPECT_VAL("E", "UUUU");
CU_ASSERT_PTR_NULL(partial_parameter); CU_ASSERT_PTR_NULL(partial_parameter);
/* partial parameter: key is partial*/ /* partial parameter: key is partial */
PARSE("IAMAFAK", true, &partial_parameter); PARSE("IAMAFAK", true, &partial_parameter);
CU_ASSERT_STRING_EQUAL(partial_parameter, "IAMAFAK"); CU_ASSERT_STRING_EQUAL(partial_parameter, "IAMAFAK");
CU_ASSERT(rc == 0); CU_ASSERT(rc == 0);
@ -327,7 +327,7 @@ parse_invalid_test(void)
CU_ASSERT(rc != 0); CU_ASSERT(rc != 0);
EXPECT_NULL("CHAP_C"); EXPECT_NULL("CHAP_C");
/* Test simple value, length of value bigger than 255*/ /* Test simple value, length of value bigger than 255 */
len = strlen("A=") + ISCSI_TEXT_MAX_SIMPLE_VAL_LEN + 1 /* max simple value len + 1 */ + len = strlen("A=") + ISCSI_TEXT_MAX_SIMPLE_VAL_LEN + 1 /* max simple value len + 1 */ +
1 /* null terminators */; 1 /* null terminators */;
data = malloc(len); data = malloc(len);
@ -341,8 +341,8 @@ parse_invalid_test(void)
EXPECT_NULL("A"); EXPECT_NULL("A");
/* key length bigger than 63 */ /* key length bigger than 63 */
len = ISCSI_TEXT_MAX_KEY_LEN + 1 /*max key length + 1*/ + 1 /* = */ + 1 /* A */ + len = ISCSI_TEXT_MAX_KEY_LEN + 1 /* max key length + 1 */ + 1 /* = */ + 1 /* A */ +
1/* null terminators */; 1 /* null terminators */;
data = malloc(len); data = malloc(len);
SPDK_CU_ASSERT_FATAL(data != NULL); SPDK_CU_ASSERT_FATAL(data != NULL);
memset(data, 'A', len); memset(data, 'A', len);

View File

@ -497,7 +497,7 @@ parse_args(int argc, char **argv)
{ {
int op; int op;
/* default value*/ /* default value */
g_io_size_bytes = 0; g_io_size_bytes = 0;
g_time_in_sec = 0; g_time_in_sec = 0;

View File

@ -390,7 +390,7 @@ parse_args(int argc, char **argv)
int op; int op;
bool mix_specified = false; bool mix_specified = false;
/* default value*/ /* default value */
g_queue_depth = 0; g_queue_depth = 0;
g_io_size_bytes = 0; g_io_size_bytes = 0;
workload_type = NULL; workload_type = NULL;

View File

@ -1266,7 +1266,7 @@ test_nvme_ctrlr_construct_intel_support_log_page_list(void)
res = spdk_nvme_ctrlr_is_log_page_supported(&ctrlr, SPDK_NVME_INTEL_LOG_SMART); res = spdk_nvme_ctrlr_is_log_page_supported(&ctrlr, SPDK_NVME_INTEL_LOG_SMART);
CU_ASSERT(res == false); CU_ASSERT(res == false);
/* set valid vendor id, device id and sub device id*/ /* set valid vendor id, device id and sub device id */
ctrlr.cdata.vid = SPDK_PCI_VID_INTEL; ctrlr.cdata.vid = SPDK_PCI_VID_INTEL;
payload.temperature_statistics_log_len = 0; payload.temperature_statistics_log_len = 0;
pci_id.vendor_id = SPDK_PCI_VID_INTEL; pci_id.vendor_id = SPDK_PCI_VID_INTEL;

View File

@ -383,7 +383,7 @@ dev_stop_success(void)
task_mgmt = spdk_get_task(NULL); task_mgmt = spdk_get_task(NULL);
/* Enqueue the tasks into dev->task_mgmt_submit_queue*/ /* Enqueue the tasks into dev->task_mgmt_submit_queue */
spdk_scsi_dev_queue_mgmt_task(&dev, task_mgmt); spdk_scsi_dev_queue_mgmt_task(&dev, task_mgmt);
spdk_scsi_task_put(task); spdk_scsi_task_put(task);

View File

@ -141,7 +141,7 @@ scsi_init_set_max_unmap_lba_count_config_param(void)
struct spdk_conf *config; struct spdk_conf *config;
int rc; int rc;
/* set scsi_params.max_unmap_lba_count = 65536 of Scsi section*/ /* set scsi_params.max_unmap_lba_count = 65536 of Scsi section */
config = spdk_config_init_scsi_params("MaxUnmapLbaCount", "65536"); config = spdk_config_init_scsi_params("MaxUnmapLbaCount", "65536");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -164,7 +164,7 @@ scsi_init_set_max_unmap_block_descriptor_count_config_param(void)
int rc; int rc;
/* set scsi_params.max_unmap_block_descriptor_count = 1 /* set scsi_params.max_unmap_block_descriptor_count = 1
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("MaxUnmapBlockDescriptorCount", "1"); config = spdk_config_init_scsi_params("MaxUnmapBlockDescriptorCount", "1");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -187,7 +187,7 @@ scsi_init_set_optimal_unmap_granularity_config_param(void)
int rc; int rc;
/* set scsi_params.optimal_unmap_granularity = 0 /* set scsi_params.optimal_unmap_granularity = 0
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("OptimalUnmapGranularity", "0"); config = spdk_config_init_scsi_params("OptimalUnmapGranularity", "0");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -210,7 +210,7 @@ scsi_init_set_unmap_granularity_alignment_config_param(void)
int rc; int rc;
/* set scsi_params.unmap_granularity_alignment = 0 /* set scsi_params.unmap_granularity_alignment = 0
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("UnmapGranularityAlignment", "0"); config = spdk_config_init_scsi_params("UnmapGranularityAlignment", "0");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -233,7 +233,7 @@ scsi_init_ugavalid_yes(void)
int rc; int rc;
/* set scsi_params.ugavalid = Yes /* set scsi_params.ugavalid = Yes
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("Ugavalid", "Yes"); config = spdk_config_init_scsi_params("Ugavalid", "Yes");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -256,7 +256,7 @@ scsi_init_ugavalid_no(void)
int rc; int rc;
/* set scsi_params.ugavalid = No /* set scsi_params.ugavalid = No
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("Ugavalid", "No"); config = spdk_config_init_scsi_params("Ugavalid", "No");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -279,7 +279,7 @@ scsi_init_ugavalid_unknown_value_failure(void)
struct spdk_conf *config; struct spdk_conf *config;
/* set scsi_params.ugavalid = unknown value /* set scsi_params.ugavalid = unknown value
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("Ugavalid", "unknown value"); config = spdk_config_init_scsi_params("Ugavalid", "unknown value");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();
@ -302,7 +302,7 @@ scsi_init_max_write_same_length(void)
int rc; int rc;
/* set scsi_params.max_write_same_length = 512 /* set scsi_params.max_write_same_length = 512
* of Scsi section*/ * of Scsi section */
config = spdk_config_init_scsi_params("MaxWriteSameLength", "512"); config = spdk_config_init_scsi_params("MaxWriteSameLength", "512");
spdk_conf_set_as_default(config); spdk_conf_set_as_default(config);
rc = spdk_scsi_subsystem_init(); rc = spdk_scsi_subsystem_init();

View File

@ -281,7 +281,7 @@ lun_task_mgmt_execute_abort_task_not_supported(void)
spdk_scsi_lun_execute_tasks(lun); spdk_scsi_lun_execute_tasks(lun);
/*task should now be on the tasks list */ /* task should now be on the tasks list */
CU_ASSERT(!TAILQ_EMPTY(&lun->tasks)); CU_ASSERT(!TAILQ_EMPTY(&lun->tasks));
rc = spdk_scsi_lun_task_mgmt_execute(mgmt_task); rc = spdk_scsi_lun_task_mgmt_execute(mgmt_task);
@ -353,7 +353,7 @@ lun_task_mgmt_execute_abort_task_all_not_supported(void)
spdk_scsi_lun_execute_tasks(lun); spdk_scsi_lun_execute_tasks(lun);
/*task should now be on the tasks list */ /* task should now be on the tasks list */
CU_ASSERT(!TAILQ_EMPTY(&lun->tasks)); CU_ASSERT(!TAILQ_EMPTY(&lun->tasks));
rc = spdk_scsi_lun_task_mgmt_execute(mgmt_task); rc = spdk_scsi_lun_task_mgmt_execute(mgmt_task);
@ -483,7 +483,7 @@ lun_append_task_null_lun_alloc_len_lt_4096(void)
task->cdb[3] = 0; task->cdb[3] = 0;
task->cdb[4] = 0; task->cdb[4] = 0;
/* alloc_len is set to a minimal value of 4096 /* alloc_len is set to a minimal value of 4096
* Hence, rbuf of size 4096 is allocated*/ * Hence, rbuf of size 4096 is allocated */
spdk_scsi_task_process_null_lun(task); spdk_scsi_task_process_null_lun(task);
CU_ASSERT_EQUAL(task->status, SPDK_SCSI_STATUS_GOOD); CU_ASSERT_EQUAL(task->status, SPDK_SCSI_STATUS_GOOD);