From d1b3a9359ac2db40695d933e2e714eb23376b9c8 Mon Sep 17 00:00:00 2001 From: srajum Date: Wed, 25 Aug 2021 12:28:07 +0530 Subject: [PATCH] gpu: nvgpu: fixing MISRA Violations - MISRA C-2012 Rule 10.5 The values of an expression should not be cast to an inappropriate essential type. - MISRA C-2012 Rule 21.18 The size_t argument passed to any function shall have an appropriate value. JIRA NVGPU-7056 Change-Id: I6a9f0de0b2e235cef3a9550a318a106d89a9ab49 Signed-off-by: srajum Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2583109 (cherry picked from commit 65c73e71e65849a3af8e6c87811e24134d00dfb5) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673651 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Rajesh Devaraj Reviewed-by: Ankur Kishore GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/mm/as.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/mm/as.c b/drivers/gpu/nvgpu/common/mm/as.c index 1b3fc1fdb..d57a8639f 100644 --- a/drivers/gpu/nvgpu/common/mm/as.c +++ b/drivers/gpu/nvgpu/common/mm/as.c @@ -78,7 +78,7 @@ static int gk20a_vm_alloc_share(struct gk20a_as_share *as_share, big_pages = false; big_page_size = g->ops.mm.gmmu.get_default_big_page_size(); } else { - if (!is_power_of_2(big_page_size)) { + if (is_power_of_2(big_page_size) == false) { return -EINVAL; }