Skip to content

Commit

Permalink
REVIEW: fix/suppress linter warnings (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin petrov authored Sep 29, 2022
1 parent 99dd757 commit aef4e4f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Checks: >
misc-static-assert,
misc-unused-parameters,
readability-redundant-control-flow
WarningsAsErrors: ''
WarningsAsErrors: '*'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ jobs:
run: |
echo "Workspace: ${GITHUB_WORKSPACE}"
cd ${GITHUB_WORKSPACE}
run-clang-tidy-${CLANG_VER} -p /tmp/
run-clang-tidy-${CLANG_VER} -p /tmp/ 2>&1 | tee /tmp/clang_tidy.log
nerrors=$(grep 'error:' /tmp/clang_tidy.log | wc -l)
if [ $nerrors -ne 0 ]; then
exit 125;
fi
make clean
rm -rf /tmp/ucc
- name: Run gtest ASAN
Expand Down
6 changes: 6 additions & 0 deletions src/components/cl/hier/allreduce/allreduce_split_rail.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ static ucc_status_t ucc_cl_hier_allreduce_split_rail_frag_init(
}

node_size = cl_team->sbgps[UCC_HIER_SBGP_NODE].sbgp->group_size;
if (ucc_unlikely(0 == node_size)) {
/* this check is only needed to suppress clang-tidy linter which
assumes potential devision-by-zero when node_size is passed to
ucc_buffer_block_count */
goto err_rs;
}
node_rank = cl_team->sbgps[UCC_HIER_SBGP_NODE].sbgp->group_rank;
total_count = coll_args->args.dst.info.count;

Expand Down
4 changes: 2 additions & 2 deletions src/core/ucc_coll.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ UCC_CORE_PROFILE_FUNC(ucc_status_t, ucc_collective_post, (request),
}

UCC_CORE_PROFILE_FUNC(ucc_status_t, ucc_collective_init_and_post,
(coll_args, request, team), ucc_coll_args_t *coll_args,
ucc_coll_req_h *request, ucc_team_h team)
(coll_args, request, team), ucc_coll_args_t *coll_args, //NOLINT
ucc_coll_req_h *request, ucc_team_h team) //NOLINT
{
ucc_error("ucc_collective_init_and_post() is not implemented");

Expand Down
6 changes: 3 additions & 3 deletions src/schedule/ucc_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
#include "coll_score/ucc_coll_score.h"
#include "core/ucc_context.h"

static void ucc_coll_task_mpool_obj_init(ucc_mpool_t *mp, void *obj,
void *chunk)
static void ucc_coll_task_mpool_obj_init(ucc_mpool_t *mp, void *obj, //NOLINT
void *chunk) //NOLINT
{
ucc_coll_task_t *task = obj;

ucc_coll_task_construct(task);
}

static void ucc_coll_task_mpool_obj_cleanup(ucc_mpool_t *mp, void *obj)
static void ucc_coll_task_mpool_obj_cleanup(ucc_mpool_t *mp, void *obj) //NOLINT
{
ucc_coll_task_t *task = obj;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/khash.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static kh_inline khint_t __ac_X31_hash_string(const char *s)
/*! @function
@abstract Const char* comparison function
*/
#define kh_str_hash_equal(a, b) (strcmp(a, b) == 0)
#define kh_str_hash_equal(a, b) (strcmp(a, b) == 0) /* NOLINT */

static kh_inline khint_t __ac_Wang_hash(khint_t key)
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ucc_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int ucc_file_parse_handler(void *arg, const char *section, //NOLINT
ucc_error("failed to dup str for kh_val");
return 0;
}
kh_val(vars, iter) = dup;
kh_val(vars, iter) = dup; //NOLINT
return 1;
}

Expand Down

0 comments on commit aef4e4f

Please sign in to comment.