mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: resolve MISRA 17.7 for WARN_ON
MISRA Rule-17.7 requires the return value of all functions to be used. Fix is either to use the return value or change the function to return void. This patch ensures that WARN and WARN_ON always return void; and introduces a new nvgpu_do_assert construct to trigger the equivalent of WARN_ON(true) so that stack can be dumped (depends on OS support) JIRA NVGPU-677 Change-Id: Ie2312c5588ceb5b1db825d15a096149b63b69af4 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2018706 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
1547008dac
commit
ee6ef2a719
@@ -198,7 +198,8 @@ int nvgpu_gmmu_init_page_table(struct vm_gk20a *vm)
|
||||
pdb_size = ALIGN(pd_size(&vm->mmu_levels[0], &attrs), PAGE_SIZE);
|
||||
|
||||
err = nvgpu_pd_alloc(vm, &vm->pdb, pdb_size);
|
||||
if (WARN_ON(err != 0)) {
|
||||
if (err != 0) {
|
||||
nvgpu_do_assert();
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user