From 186e0291ab827c26674a8216f71dc3c7353b1e00 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Tue, 18 Sep 2018 10:28:15 -0400 Subject: gpu: nvgpu: commonize errs in *get_litter_value() No one is checking return values for the *get_litter_value() functions in the 100s of references, and some of the *get_litter_value() functions were already doing a BUG(), we'll just call BUG() in all them. And since we don't return in the error case, and there's no guarantee that an errno won't collide with the litter values, we'll just initialize the local ret value to 0 to avoid problems and confusion. JIRA NVGPU-647 Change-Id: Id974c904a142c4b3abf1ab940121c270208b0b83 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/1830582 GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Long Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp10b') diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 1050c89f..a2658275 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -90,7 +90,7 @@ u32 gp10b_get_litter_value(struct gk20a *g, int value) { - u32 ret = EINVAL; + u32 ret = 0; switch (value) { case GPU_LIT_NUM_GPCS: ret = proj_scal_litter_num_gpcs_v(); -- cgit v1.2.2