33 * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
44 * reserved.
55 * Copyright (c) 2020 Google, LLC. All rights reserved.
6+ * Copyright (c) 2020 Intel, Inc. All rights reserved.
67 * $COPYRIGHT$
78 *
89 * Additional copyrights may follow
@@ -100,7 +101,7 @@ static ompi_osc_rdma_region_t *find_insertion_point (ompi_osc_rdma_region_t *reg
100101 return (ompi_osc_rdma_region_t * )((intptr_t ) regions + min_index * region_size );
101102 }
102103
103- if (region -> base > base || (region -> base == base && region -> len > region_size )) {
104+ if (region -> base > base || (region -> base == base && ( size_t ) region -> len > region_size )) {
104105 return find_insertion_point (regions , min_index , mid_index - 1 , base , region_size , region_index );
105106 }
106107
@@ -113,8 +114,8 @@ static bool ompi_osc_rdma_find_conflicting_attachment (ompi_osc_rdma_handle_t *h
113114
114115 OPAL_LIST_FOREACH (attachment , & handle -> attachments , ompi_osc_rdma_attachment_t ) {
115116 intptr_t region_bound = attachment -> base + attachment -> len ;
116- if (base >= attachment -> base && base < region_bound ||
117- bound > attachment -> base && bound <= region_bound ) {
117+ if (( base >= attachment -> base && base < region_bound ) ||
118+ ( bound > attachment -> base && bound <= region_bound ) ) {
118119 OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "existing region {%p, %p} overlaps region {%p, %p}" ,
119120 (void * ) attachment -> base , (void * ) region_bound , (void * ) base , (void * ) bound );
120121 return true;
@@ -295,8 +296,7 @@ int ompi_osc_rdma_detach (struct ompi_win_t *win, const void *base)
295296 ompi_osc_rdma_handle_t * rdma_region_handle ;
296297 osc_rdma_counter_t region_count , region_id ;
297298 ompi_osc_rdma_region_t * region ;
298- void * bound ;
299- int start_index = INT_MAX , region_index ;
299+ int region_index ;
300300
301301 if (module -> flavor != MPI_WIN_FLAVOR_DYNAMIC ) {
302302 return OMPI_ERR_WIN ;
@@ -313,9 +313,9 @@ int ompi_osc_rdma_detach (struct ompi_win_t *win, const void *base)
313313 rdma_region_handle = module -> dynamic_handles [region_index ];
314314 region = (ompi_osc_rdma_region_t * ) ((intptr_t ) module -> state -> regions + region_index * module -> region_size );
315315 OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_INFO , "checking attachments at index %d {.base=%p, len=%lu} for attachment %p"
316- ", region handle=%p" , region_index , (void * ) region -> base , region -> len , base , rdma_region_handle );
316+ ", region handle=%p" , region_index , (void * ) region -> base , ( unsigned long ) region -> len , base , ( void * ) rdma_region_handle );
317317
318- if (region -> base > (uintptr_t ) base || (region -> base + region -> len ) < (uintptr_t ) base ) {
318+ if (( uintptr_t ) region -> base > (uintptr_t ) base || ( uintptr_t ) (region -> base + region -> len ) < (uintptr_t ) base ) {
319319 continue ;
320320 }
321321
0 commit comments