Skip to content

Commit b7f9221

Browse files
committed
osc_rdma: do pointer match on (const char*)
Don't do pointer math on (void*). Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent cea0e24 commit b7f9221

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,11 @@ static int ompi_osc_rdma_fetch_and_op_cas (ompi_osc_rdma_sync_t *sync, const voi
294294
return ret;
295295
}
296296
} else if (&ompi_mpi_op_no_op.op != op) {
297-
ret = osc_rdma_is_accel(origin_addr + dt->super.true_lb);
297+
ret = osc_rdma_is_accel(((const char*) origin_addr) + dt->super.true_lb);
298298
if (0 < ret) {
299299
tmp_origin = malloc(dt->super.size);
300300
ret = opal_accelerator.mem_copy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
301-
tmp_origin, origin_addr + dt->super.true_lb, dt->super.size, MCA_ACCELERATOR_TRANSFER_DTOH);
301+
tmp_origin, ((const char*) origin_addr) + dt->super.true_lb, dt->super.size, MCA_ACCELERATOR_TRANSFER_DTOH);
302302
ompi_op_reduce (op, (void *) tmp_origin, (void*)((ptrdiff_t) &new_value + offset), 1, dt);
303303
free(tmp_origin);
304304
} else if (0 == ret) {

0 commit comments

Comments
 (0)