Skip to content

Commit 91c4c29

Browse files
committed
Fix a variety of compiler warnings
- Remove dead code - Fix shadow variable declarations - Cast %p arguments to (void*) - Make integer comparisons agree in sign - Make a local function static so that it does not require a prior declaration Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 31fc6e0 commit 91c4c29

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

ompi/mca/coll/han/coll_han_module.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* of Tennessee Research Foundation. All rights
44
* reserved.
55
* Copyright (c) 2020 Bull S.A.S. All rights reserved.
6+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -222,8 +223,6 @@ mca_coll_han_comm_query(struct ompi_communicator_t * comm, int *priority)
222223
han_module->topologic_level = GLOBAL_COMMUNICATOR;
223224

224225
if (NULL != comm->super.s_info) {
225-
char info_val[OPAL_MAX_INFO_VAL+1];
226-
227226
/* Get the info value disaqualifying coll components */
228227
opal_cstring_t *info_str;
229228
opal_info_get(comm->super.s_info, "ompi_comm_coll_han_topo_level",

ompi/mca/part/persist/part_persist.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2019-2021 Sandia National Laboratories. All rights reserved.
1313
* Copyright (c) 2021 University of Alabama at Birmingham. All rights reserved.
1414
* Copyright (c) 2021 Tennessee Technological University. All rights reserved.
15+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -313,8 +314,10 @@ mca_part_persist_progress(void)
313314
OPAL_THREAD_UNLOCK(&ompi_part_persist.lock);
314315
block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1);
315316
if(to_delete) {
316-
int err = mca_part_persist_free_req(to_delete);
317-
if(OMPI_SUCCESS != err) return OMPI_ERROR;
317+
err = mca_part_persist_free_req(to_delete);
318+
if (OMPI_SUCCESS != err) {
319+
return OMPI_ERROR;
320+
}
318321
}
319322

320323
return OMPI_SUCCESS;

ompi/mca/vprotocol/pessimist/vprotocol_pessimist_wait.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
33
* All rights reserved.
4+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
45
* $COPYRIGHT$
56
*
67
* Additional copyrights may follow
@@ -19,7 +20,7 @@ static int vprotocol_pessimist_request_no_free(ompi_request_t **req) {
1920
}
2021

2122
#define PREPARE_REQUESTS_WITH_NO_FREE(count, requests) do { \
22-
for(int i = 0; i < count; i++) \
23+
for (typeof(count) i = 0; i < count; i++) \
2324
{ \
2425
if(requests[i] == MPI_REQUEST_NULL) continue; \
2526
requests[i]->req_free = vprotocol_pessimist_request_no_free; \

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2020-2021 Google, LLC. All rights reserved.
6+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -480,7 +481,7 @@ mca_btl_base_rdma_start(mca_btl_base_module_t *btl, struct mca_btl_base_endpoint
480481

481482
BTL_VERBOSE(("Initiating RDMA operation. context=%p, size=%" PRIsize_t
482483
", packet_size=%" PRIsize_t,
483-
context, size, packet_size));
484+
(void*) context, size, packet_size));
484485

485486
descriptor = btl->btl_alloc(btl, endpoint, order, packet_size,
486487
MCA_BTL_DES_SEND_ALWAYS_CALLBACK | MCA_BTL_DES_FLAGS_SIGNAL);
@@ -609,7 +610,7 @@ static int mca_btl_base_am_rdma_respond(mca_btl_base_module_t *btl,
609610
}
610611
}
611612

612-
BTL_VERBOSE(("sending descriptor %p", send_descriptor));
613+
BTL_VERBOSE(("sending descriptor %p", (void*) send_descriptor));
613614

614615
send_descriptor->des_cbfunc = NULL;
615616

@@ -638,7 +639,7 @@ mca_btl_base_am_rmda_rdma_complete(mca_btl_base_module_t *btl,
638639
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
639640
BTL_VERBOSE(
640641
("could not send a response. queueing the response for later. endpoint=%p, ret=%d",
641-
endpoint, ret));
642+
(void*) endpoint, ret));
642643
mca_btl_base_rdma_queue_operation(btl, NULL, NULL, 0, NULL, operation);
643644
}
644645

@@ -873,7 +874,7 @@ static void mca_btl_base_am_rdma_response(mca_btl_base_module_t *btl,
873874
mca_btl_base_rdma_context_t *context = (mca_btl_base_rdma_context_t *) (uintptr_t)
874875
resp_hdr->context;
875876

876-
BTL_VERBOSE(("received response for RDMA operation. context=%p, size=%" PRIu64, context,
877+
BTL_VERBOSE(("received response for RDMA operation. context=%p, size=%" PRIu64, (void*) context,
877878
resp_hdr->response_size));
878879

879880
if (MCA_BTL_BASE_AM_PUT != context->type) {
@@ -890,7 +891,7 @@ static void mca_btl_base_am_rdma_response(mca_btl_base_module_t *btl,
890891
}
891892

892893
if (context->total_size
893-
== opal_atomic_add_fetch_64(&context->acknowledged, resp_hdr->response_size)) {
894+
== (uint64_t) opal_atomic_add_fetch_64(&context->acknowledged, resp_hdr->response_size)) {
894895
context->cbfunc(btl, desc->endpoint, context->local_address, context->local_handle,
895896
context->cbcontext, context->cbdata, OPAL_SUCCESS);
896897
OBJ_RELEASE(context);
@@ -1001,7 +1002,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
10011002
}
10021003
}
10031004

1004-
void mca_btl_sm_sc_emu_init(void)
1005+
static void mca_btl_sm_sc_emu_init(void)
10051006
{
10061007
mca_btl_base_active_message_trigger[MCA_BTL_BASE_TAG_RDMA].cbfunc
10071008
= mca_btl_base_am_process_rdma;
@@ -1093,19 +1094,19 @@ int mca_btl_base_am_rdma_init(mca_btl_base_module_t *btl)
10931094
btl->btl_put_limit = max_operation_size - sizeof(mca_btl_base_rdma_hdr_t);
10941095
btl->btl_put_alignment = operation_alignment;
10951096
btl->btl_put = mca_btl_base_am_rdma_put;
1096-
BTL_VERBOSE(("Enabling AM-based RDMA put for BTL %p. max put = %zu", btl, btl->btl_put_limit));
1097+
BTL_VERBOSE(("Enabling AM-based RDMA put for BTL %p. max put = %zu", (void*) btl, btl->btl_put_limit));
10971098
}
10981099

10991100
if (!(btl->btl_flags & MCA_BTL_FLAGS_GET)) {
11001101
btl->btl_flags |= MCA_BTL_FLAGS_GET_AM;
11011102
btl->btl_get_limit = max_operation_size - sizeof(mca_btl_base_rdma_response_hdr_t);
11021103
btl->btl_get_alignment = operation_alignment;
11031104
btl->btl_get = mca_btl_base_am_rdma_get;
1104-
BTL_VERBOSE(("Enabling AM-based RDMA get for BTL %p. max get = %zu", btl, btl->btl_get_limit));
1105+
BTL_VERBOSE(("Enabling AM-based RDMA get for BTL %p. max get = %zu", (void*) btl, btl->btl_get_limit));
11051106
}
11061107

11071108
if (!(btl->btl_flags & MCA_BTL_FLAGS_ATOMIC_FOPS)) {
1108-
BTL_VERBOSE(("Enabling AM-based FOPs get for BTL %p", btl));
1109+
BTL_VERBOSE(("Enabling AM-based FOPs get for BTL %p", (void*) btl));
11091110
btl->btl_flags |= MCA_BTL_FLAGS_ATOMIC_AM_FOP;
11101111

11111112
btl->btl_atomic_fop = mca_btl_base_am_fop;

0 commit comments

Comments
 (0)