summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/rbtree.c
diff options
context:
space:
mode:
authorSrirangan <smadhavan@nvidia.com>2018-08-01 03:32:14 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-02 16:56:31 -0400
commit63e6e8ee3ee9ce01b1f7d4c0014bb589df105d71 (patch)
treef4db057c93973a9ad4afa15d1c6e5e1f2440c241 /drivers/gpu/nvgpu/common/rbtree.c
parente6c135ecb70e8b966fc036587301c979ae70e869 (diff)
gpu: nvgpu: common: Fix MISRA 15.6 violations
This fixes errors due to single statement loop bodies without braces, which is part of Rule 15.6 of MISRA. This patch covers in gpu/nvgpu/common/ JIRA NVGPU-989 Change-Id: Ic6a98a1cd04e4524dabf650e2f6e73c6b5a1db9d Signed-off-by: Srirangan <smadhavan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1786207 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Adeel Raza <araza@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/rbtree.c')
-rw-r--r--drivers/gpu/nvgpu/common/rbtree.c8
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) {