From 5b47cd73fbddfa1d50ac1f97b7a36f64ee57d138 Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Mon, 13 Jan 2020 15:45:58 -0800 Subject: [PATCH] gpu: nvgpu: fix misra 14.4 and 15.6 errors in vm.c Rule 14.4 requires if statement condition to be Boolean type. Rule 15.6 requires body of if statement should be a compound statement. This patch fixes above rules in vm.c. Jira NVGPU-4780 Change-Id: Iea605ab551a1cf232b59f7dda502df89899a3480 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2278607 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c index 4d09c47d8..09a43199c 100644 --- a/drivers/gpu/nvgpu/common/mm/vm.c +++ b/drivers/gpu/nvgpu/common/mm/vm.c @@ -1040,7 +1040,9 @@ int nvgpu_vm_get_buffers(struct vm_gk20a *vm, nvgpu_rbtree_enum_next(&node, node); } - BUG_ON(i != vm->num_user_mapped_buffers); + if (i != vm->num_user_mapped_buffers) { + BUG(); + } *num_buffers = vm->num_user_mapped_buffers; *mapped_buffers = buffer_list;