From 63e6e8ee3ee9ce01b1f7d4c0014bb589df105d71 Mon Sep 17 00:00:00 2001 From: Srirangan Date: Wed, 1 Aug 2018 13:02:14 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1786207 Reviewed-by: svc-misra-checker Reviewed-by: Adeel Raza GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/buddy_allocator.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common/mm/buddy_allocator.c') diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c index b986b29f..5a0a28cb 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -214,8 +214,9 @@ static int balloc_init_lists(struct nvgpu_buddy_allocator *a) bend = a->end; /* First make sure the LLs are valid. */ - for (i = 0; i < GPU_BALLOC_ORDER_LIST_LEN; i++) + for (i = 0; i < GPU_BALLOC_ORDER_LIST_LEN; i++) { nvgpu_init_list_node(balloc_get_order_list(a, i)); + } while (bstart < bend) { order = __balloc_max_order_in(a, bstart, bend); @@ -505,8 +506,9 @@ static u64 __balloc_do_alloc(struct nvgpu_buddy_allocator *a, split_order = order; while (split_order <= a->max_order && - !(bud = __balloc_find_buddy(a, split_order, pte_size))) + !(bud = __balloc_find_buddy(a, split_order, pte_size))) { split_order++; + } /* Out of memory! */ if (!bud) @@ -885,8 +887,9 @@ static u64 __nvgpu_balloc_fixed_buddy(struct nvgpu_allocator *__a, balloc_alloc_fixed(a, falloc); nvgpu_list_for_each_entry(bud, &falloc->buddies, - nvgpu_buddy, buddy_entry) + nvgpu_buddy, buddy_entry) { real_bytes += (bud->end - bud->start); + } a->bytes_alloced += len; a->bytes_alloced_real += real_bytes; -- cgit v1.2.2