diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/rbtree.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/rbtree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/rbtree.c b/drivers/gpu/nvgpu/common/rbtree.c index d1f79cbb..86bab688 100644 --- a/drivers/gpu/nvgpu/common/rbtree.c +++ b/drivers/gpu/nvgpu/common/rbtree.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -273,8 +273,9 @@ void nvgpu_rbtree_unlink(struct nvgpu_rbtree_node *node, | |||
273 | } else { | 273 | } else { |
274 | /* find tree successor */ | 274 | /* find tree successor */ |
275 | y = z->right; | 275 | y = z->right; |
276 | while (y->left) | 276 | while (y->left) { |
277 | y = y->left; | 277 | y = y->left; |
278 | } | ||
278 | } | 279 | } |
279 | 280 | ||
280 | /* x is y's only child */ | 281 | /* x is y's only child */ |
@@ -420,8 +421,9 @@ void nvgpu_rbtree_enum_next(struct nvgpu_rbtree_node **node, | |||
420 | /* pick the leftmost node of the right subtree ? */ | 421 | /* pick the leftmost node of the right subtree ? */ |
421 | if (curr->right) { | 422 | if (curr->right) { |
422 | curr = curr->right; | 423 | curr = curr->right; |
423 | for (; curr->left;) | 424 | for (; curr->left;) { |
424 | curr = curr->left; | 425 | curr = curr->left; |
426 | } | ||
425 | } else { | 427 | } else { |
426 | /* go up until we find the right inorder node */ | 428 | /* go up until we find the right inorder node */ |
427 | for (curr = curr->parent; curr; curr = curr->parent) { | 429 | for (curr = curr->parent; curr; curr = curr->parent) { |