Skip to content

Commit

Permalink
fix: topo: delete impossible break statement
Browse files Browse the repository at this point in the history
The check immediately prior is that userdata is null, and then the first
thing we do after that is check if it is null and attempt to break out
of the scope we just entered. clang-sa complains that this is dead code.

Delete the dead code.

Signed-off-by: Nicholas Sielicki <nslick@amazon.com>
  • Loading branch information
Nicholas Sielicki committed Dec 3, 2024
1 parent ee21be7 commit 768c4d6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/nccl_ofi_topo.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,6 @@ static int set_userdata_to_root(hwloc_obj_t node,
/* Walk upwards to the root */
while (node) {
if (!node->userdata) {
/* Abort when a node is reached that already stores user data */
if (node->userdata) break;

user_data = nccl_ofi_get_user_data(data_iter);
if (!user_data) {
NCCL_OFI_WARN("Failed to access user data of data_iter");
Expand Down

0 comments on commit 768c4d6

Please sign in to comment.