3
3
* Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights
4
4
* reserved.
5
5
* Copyright (c) 2020-2021 Google, LLC. All rights reserved.
6
- * Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
6
+ * Copyright (c) 2021-2022 Cisco Systems, Inc. All rights reserved
7
7
* $COPYRIGHT$
8
8
*
9
9
* Additional copyrights may follow
@@ -976,15 +976,16 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
976
976
switch (hdr -> type ) {
977
977
case MCA_BTL_BASE_AM_ATOMIC :
978
978
if (4 == hdr -> data .atomic .size ) {
979
- uint32_t tmp = (uint32_t ) atomic_response ;
980
- mca_btl_base_am_atomic_32 (& tmp , (opal_atomic_int32_t * ) ( uintptr_t ) hdr -> target_address ,
979
+ int32_t tmp = (int32_t ) atomic_response ;
980
+ mca_btl_base_am_atomic_32 (& tmp , (opal_atomic_int32_t * ) hdr -> target_address ,
981
981
hdr -> data .atomic .op );
982
982
atomic_response = tmp ;
983
- }
984
- if ( 8 == hdr -> data . atomic . size ) {
985
- mca_btl_base_am_atomic_64 (& atomic_response ,
986
- (opal_atomic_int64_t * ) ( uintptr_t ) hdr -> target_address ,
983
+ } else if ( 8 == hdr -> data . atomic . size ) {
984
+ int64_t tmp = ( int64_t ) atomic_response ;
985
+ mca_btl_base_am_atomic_64 (& tmp ,
986
+ (opal_atomic_int64_t * ) hdr -> target_address ,
987
987
hdr -> data .atomic .op );
988
+ atomic_response = tmp ;
988
989
}
989
990
break ;
990
991
case MCA_BTL_BASE_AM_CAS :
@@ -993,8 +994,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
993
994
opal_atomic_compare_exchange_strong_32 ((opal_atomic_int32_t * ) hdr -> target_address ,
994
995
& tmp , (int32_t ) hdr -> data .atomic .operand [1 ]);
995
996
atomic_response = tmp ;
996
- }
997
- if (8 == hdr -> data .atomic .size ) {
997
+ } else if (8 == hdr -> data .atomic .size ) {
998
998
opal_atomic_compare_exchange_strong_64 ((opal_atomic_int64_t * ) hdr -> target_address ,
999
999
& atomic_response , hdr -> data .atomic .operand [1 ]);
1000
1000
}
0 commit comments