gpu: nvgpu: fix misra violations common.mm.vm

This patch fixes misra violations in common/mm/vm.c.

Rule 13.5 doesn't allow right hand operands of a logical operator to
have persistent side effects. This patch translates logical operations
to conditional operation.

Change-Id: I83db6dba016eb353905a3887e7c47683b44b77d6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2140974
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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>
This commit is contained in:
Vedashree Vidwans
2019-06-21 16:07:05 -07:00
committed by mobile promotions
parent 164beb87b5
commit 4d6fc3780c

View File

@@ -532,15 +532,19 @@ int nvgpu_vm_do_init(struct mm_gk20a *mm,
* Determine if big pages are possible in this VM. If a split address
* space is used then check the user_lp vma instead of the user vma.
*/
if (big_pages) {
if (unified_va) {
vm->big_pages = big_pages &&
nvgpu_big_pages_possible(vm, user_vma_start,
vm->big_pages = nvgpu_big_pages_possible(vm,
user_vma_start,
user_vma_limit - user_vma_start);
} else {
vm->big_pages = big_pages &&
nvgpu_big_pages_possible(vm, user_lp_vma_start,
vm->big_pages = nvgpu_big_pages_possible(vm,
user_lp_vma_start,
user_lp_vma_limit - user_lp_vma_start);
}
} else {
vm->big_pages = false;
}
/*
* User VMA.