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

@ -289,10 +289,10 @@ struct spdk_bdev_io {
*/
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;
/** 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;
/** Member used for linking child I/Os together. */

View File

@ -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);
}
/* This function is used to hanlde the r2t snack*/
/* This function is used to handle the r2t snack */
static int
spdk_iscsi_handle_r2t_snack(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task,

View File

@ -621,7 +621,7 @@ spdk_iscsi_construct_data_from_param(struct iscsi_param *param, char *new_val,
/**
* To negotiate param with
* 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,
struct iscsi_param *param,
@ -670,7 +670,7 @@ static char *spdk_iscsi_negotiate_param_list(int *add_param_value,
/**
* To negotiate param with
* 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,
struct iscsi_param *param,
@ -725,7 +725,7 @@ static char *spdk_iscsi_negotiate_param_numerical(int *add_param_value,
/**
* To negotiate param with
* 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,
struct iscsi_param *param,

View File

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

View File

@ -345,12 +345,12 @@ nvmf_virtual_ctrlr_process_admin_cmd(struct spdk_nvmf_request *req)
case SPDK_NVME_OPC_KEEP_ALIVE:
SPDK_TRACELOG(SPDK_TRACE_NVMF, "Keep Alive\n");
/*
To handle keep alive just clear or reset the
session based keep alive duration counter.
When added, a separate timer based process
will monitor if the time since last recorded
keep alive has exceeded the max duration and
take appropriate action.
* To handle keep alive just clear or reset the
* session based keep alive duration counter.
* When added, a separate timer based process
* will monitor if the time since last recorded
* keep alive has exceeded the max duration and
* take appropriate action.
*/
//session->keep_alive_timestamp = ;
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);
}
/*!
/**
\brief Constructs a new spdk_scsi_lun object based on the provided parameters.

View File

@ -36,6 +36,20 @@ else
echo "You do not have astyle installed so your code style is not being checked!"
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..."
if ! git grep -I -l -e . -z | \