Skip to content

Commit

Permalink
SHM: code beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Oblomov committed Dec 8, 2019
1 parent d05e4a0 commit 072968a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ucs/sys/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,9 +1238,10 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint64_t *low)
&v5[3], &v5[4], &v5[5]);
if (res == 10) { /* 10 values should be scanned */
status = UCS_OK;
boot_id.low = (uint64_t)v1 | ((uint64_t)v2 << 32) | ((uint64_t)v3 << 48);
boot_id.low = ((uint64_t)v1) | ((uint64_t)v2 << 32) |
((uint64_t)v3 << 48);
boot_id.high = v4;
for (i = 0; i < sizeof(v5); i++) {
for (i = 0; i < ucs_array_size(v5); i++) {
boot_id.high |= (uint64_t)v5[i] << (16 + (i * 8));
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/uct/sm/base/sm_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ int uct_sm_iface_is_reachable(const uct_iface_h tl_iface,

/* do not merge these evaluations into single 'if' due
* to clags compilation warning */
/* check if both processes are on same host and
* both of them are in root (or non-root) pid namespace */
if (ext_addr->super.id != my_addr.super.id) {
return 0;
}
Expand All @@ -108,6 +110,8 @@ int uct_sm_iface_is_reachable(const uct_iface_h tl_iface,
return 1; /* both processes are in root namespace */
}

/* ok, we are in non-root PID namespace - return 1 if ID of
* namespaces are same */
return ext_addr->ipc_ns == my_addr.ipc_ns;
}

Expand Down

0 comments on commit 072968a

Please sign in to comment.