Skip to content

Commit 8c374f0

Browse files
committed
Squash clang-14 warnings in OPAL
- Set but unused rc - Shadowed fifo variable - Format string warning (void* vs char*) Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
1 parent 6ab6775 commit 8c374f0

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

opal/mca/btl/smcuda/btl_smcuda.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ static void mca_btl_smcuda_send_cuda_ipc_request(struct mca_btl_base_module_t *b
12611261

12621262
MCA_BTL_SMCUDA_FIFO_WRITE(endpoint, endpoint->my_smp_rank, endpoint->peer_smp_rank,
12631263
(void *) VIRTUAL2RELATIVE(frag->hdr), false, true, rc);
1264+
(void)rc;
12641265
return;
12651266
}
12661267

opal/mca/btl/smcuda/btl_smcuda_component.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ static void mca_btl_smcuda_send_cuda_ipc_ack(struct mca_btl_base_module_t *btl,
634634

635635
MCA_BTL_SMCUDA_FIFO_WRITE(endpoint, endpoint->my_smp_rank, endpoint->peer_smp_rank,
636636
(void *) VIRTUAL2RELATIVE(frag->hdr), false, true, rc);
637+
(void)rc;
637638

638639
/* Set state now that we have sent message */
639640
if (ready) {
@@ -1040,6 +1041,7 @@ int mca_btl_smcuda_component_progress(void)
10401041
/* return the fragment */
10411042
MCA_BTL_SMCUDA_FIFO_WRITE(mca_btl_smcuda_component.sm_peers[peer_smp_rank], my_smp_rank,
10421043
peer_smp_rank, hdr->frag, false, true, rc);
1044+
(void)rc;
10431045
break;
10441046
}
10451047
case MCA_BTL_SMCUDA_FRAG_ACK: {
@@ -1086,6 +1088,7 @@ int mca_btl_smcuda_component_progress(void)
10861088
| MCA_BTL_SMCUDA_FRAG_STATUS_MASK);
10871089
MCA_BTL_SMCUDA_FIFO_WRITE(mca_btl_smcuda_component.sm_peers[peer_smp_rank], my_smp_rank,
10881090
peer_smp_rank, hdr, false, true, rc);
1091+
(void)rc;
10891092
break;
10901093
}
10911094
}

opal/mca/btl/smcuda/btl_smcuda_fifo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,24 @@ static void add_pending(struct mca_btl_base_endpoint_t *ep, void *data, bool res
8585
#define MCA_BTL_SMCUDA_FIFO_WRITE(endpoint_peer, my_smp_rank, peer_smp_rank, hdr, resend, \
8686
retry_pending_sends, rc) \
8787
do { \
88-
sm_fifo_t *fifo = &(mca_btl_smcuda_component.fifo[peer_smp_rank][FIFO_MAP(my_smp_rank)]); \
88+
sm_fifo_t *_fifo = &(mca_btl_smcuda_component.fifo[peer_smp_rank][FIFO_MAP(my_smp_rank)]);\
8989
\
9090
if (retry_pending_sends) { \
9191
if (0 < opal_list_get_size(&endpoint_peer->pending_sends)) { \
9292
btl_smcuda_process_pending_sends(endpoint_peer); \
9393
} \
9494
} \
9595
\
96-
opal_atomic_lock(&(fifo->head_lock)); \
96+
opal_atomic_lock(&(_fifo->head_lock)); \
9797
/* post fragment */ \
98-
if (sm_fifo_write(hdr, fifo) != OPAL_SUCCESS) { \
98+
if (sm_fifo_write(hdr, _fifo) != OPAL_SUCCESS) { \
9999
add_pending(endpoint_peer, hdr, resend); \
100100
rc = OPAL_ERR_RESOURCE_BUSY; \
101101
} else { \
102102
MCA_BTL_SMCUDA_SIGNAL_PEER(endpoint_peer); \
103103
rc = OPAL_SUCCESS; \
104104
} \
105-
opal_atomic_unlock(&(fifo->head_lock)); \
105+
opal_atomic_unlock(&(_fifo->head_lock)); \
106106
} while (0)
107107

108108
#endif

opal/mca/rcache/rgpusm/rcache_rgpusm_module.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ static int mca_rcache_rgpusm_open_mem_handle(void *base, size_t size, mca_rcache
117117
if (OPAL_UNLIKELY(OPAL_SUCCESS != result)) {
118118
opal_output_verbose(10, mca_rcache_rgpusm_component.output,
119119
"open_ipc_handle failed: base=%p (remote base=%p,size=%d)",
120-
newreg->alloc_base, base, (int) size);
120+
(void*)newreg->alloc_base, base, (int) size);
121121
/* Currently, this is a non-recoverable error */
122122
return OPAL_ERROR;
123123
}
124124

125125
opal_output_verbose(10, mca_rcache_rgpusm_component.output,
126126
"open_ipc_handle passed: base=%p (remote base=%p,size=%d)",
127-
newreg->alloc_base, base, (int) size);
127+
(void*)newreg->alloc_base, base, (int) size);
128128

129129
return OPAL_SUCCESS;
130130
}
@@ -172,7 +172,7 @@ static inline bool mca_rcache_rgpusm_deregister_lru(mca_rcache_base_module_t *rc
172172
if (OPAL_SUCCESS != rc) {
173173
opal_output_verbose(10, mca_rcache_rgpusm_component.output,
174174
"RGPUSM: Failed to deregister the memory addr=%p, size=%d",
175-
old_reg->base, (int) (old_reg->bound - old_reg->base + 1));
175+
(void*)old_reg->base, (int) (old_reg->bound - old_reg->base + 1));
176176
return false;
177177
}
178178

@@ -291,7 +291,7 @@ int mca_rcache_rgpusm_register(mca_rcache_base_module_t *rcache, void *addr, siz
291291
rcache_rgpusm->stat_cache_hit++;
292292
opal_output_verbose(10, mca_rcache_rgpusm_component.output,
293293
"RGPUSM: Found addr=%p,size=%d (base=%p,size=%d) in cache", addr,
294-
(int) size, (*reg)->base, (int) ((*reg)->bound - (*reg)->base));
294+
(int) size, (void*)(*reg)->base, (int) ((*reg)->bound - (*reg)->base));
295295

296296
if (0 ==
297297
memcmp(((mca_opal_gpu_reg_t *)*reg)->data.ipcHandle.handle, rget_reg->data.ipcHandle.handle,
@@ -303,7 +303,7 @@ int mca_rcache_rgpusm_register(mca_rcache_base_module_t *rcache, void *addr, siz
303303
opal_output_verbose(10, mca_rcache_rgpusm_component.output,
304304
"RGPUSM: Mismatched Handle: Evicting/unregistering "
305305
"addr=%p,size=%d (base=%p,size=%d) from cache",
306-
addr, (int) size, (*reg)->base,
306+
addr, (int) size, (void*)(*reg)->base,
307307
(int) ((*reg)->bound - (*reg)->base));
308308

309309
/* The ref_count has to be zero as this memory cannot possibly
@@ -507,10 +507,6 @@ int mca_rcache_rgpusm_find(struct mca_rcache_base_module_t *rcache, void *addr,
507507
{
508508
mca_rcache_rgpusm_module_t *rcache_rgpusm = (mca_rcache_rgpusm_module_t *) rcache;
509509
int rc;
510-
unsigned char *base, *bound;
511-
512-
base = addr;
513-
bound = base + size - 1; /* To keep cache hits working correctly */
514510

515511
OPAL_THREAD_LOCK(&rcache->lock);
516512
opal_output(-1, "Looking for addr=%p, size=%d", addr, (int) size);
@@ -554,7 +550,7 @@ int mca_rcache_rgpusm_deregister(struct mca_rcache_base_module_t *rcache,
554550
opal_output_verbose(20, mca_rcache_rgpusm_component.output,
555551
"RGPUSM: Deregister: addr=%p, size=%d: cacheable and pinned, leave in "
556552
"cache, PUSH IN LRU",
557-
reg->base, (int) (reg->bound - reg->base + 1));
553+
(void*)reg->base, (int) (reg->bound - reg->base + 1));
558554
opal_list_prepend(&rcache_rgpusm->lru_list, (opal_list_item_t *) reg);
559555
} else {
560556
/* Remove from rcache first */

0 commit comments

Comments
 (0)