Skip to content

Commit bf75faf

Browse files
committed
btl/am-rdma: Clean up warnings
Remove unused function warning for the unused size_t max function. Remove unused variable length array argument in the header. While the existance of the variable length array argument itself isn't a problem, that header is included in the middle of another structure, which is a no-no. Since we don't use the variable length array member, simplest solution is to remove it. Copy the same compare and swap type enforcement for the 8 byte CAS case as other similar cases (both 4 byte CAS and other atomics). Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 8fd7189 commit bf75faf

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ struct mca_btl_base_rdma_hdr_t {
176176
/* the following fields are not used on the target and are only relevant
177177
* to the initiator */
178178
uint64_t context;
179-
180-
/* registration handles (if required) */
181-
uint8_t handle_data[];
182179
};
183180
typedef struct mca_btl_base_rdma_hdr_t mca_btl_base_rdma_hdr_t;
184181

@@ -218,11 +215,6 @@ static inline size_t size_t_min(size_t a, size_t b)
218215
return (a < b) ? a : b;
219216
}
220217

221-
static inline size_t size_t_max(size_t a, size_t b)
222-
{
223-
return (a > b) ? a : b;
224-
}
225-
226218
static mca_btl_base_am_rdma_module_t default_module;
227219

228220
static inline bool mca_btl_base_rdma_use_rdma_get(mca_btl_base_module_t *btl)
@@ -1009,8 +1001,10 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
10091001
&tmp, (int32_t) hdr->data.atomic.operand[1]);
10101002
atomic_response = tmp;
10111003
} else if (8 == hdr->data.atomic.size) {
1004+
int64_t tmp = (int64_t) atomic_response;
10121005
opal_atomic_compare_exchange_strong_64((opal_atomic_int64_t *) hdr->target_address,
1013-
&atomic_response, hdr->data.atomic.operand[1]);
1006+
&tmp, hdr->data.atomic.operand[1]);
1007+
atomic_response = tmp;
10141008
}
10151009
break;
10161010
default:

0 commit comments

Comments
 (0)