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 <string.h>
  shall have an appropriate value.

JIRA NVGPU-7056

Change-Id: I6a9f0de0b2e235cef3a9550a318a106d89a9ab49
Signed-off-by: srajum <srajum@nvidia.com>
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 <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
srajum
2021-08-25 12:28:07 +05:30
committed by mobile promotions
parent f45762d032
commit d1b3a9359a

View File

@@ -78,7 +78,7 @@ static int gk20a_vm_alloc_share(struct gk20a_as_share *as_share,
big_pages = false; big_pages = false;
big_page_size = g->ops.mm.gmmu.get_default_big_page_size(); big_page_size = g->ops.mm.gmmu.get_default_big_page_size();
} else { } else {
if (!is_power_of_2(big_page_size)) { if (is_power_of_2(big_page_size) == false) {
return -EINVAL; return -EINVAL;
} }