From 07e5bd817a23913d120b945ced5c96951716886c Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Tue, 18 Sep 2018 10:14:05 -0400 Subject: gpu: nvgpu: fix return type of *get_litter_value() All callers for the *get_litter_value() functions were expecting u32, but the functions were declared to return int's. This is a violation of MISRA 10.3 which prohibits implicit assignment between essential types (signed int and unsigned long int, in this case). The litter values are all u32's anyway. JIRA NVGPU-647 Change-Id: I853d2abee372488e5d12e355050cbeaf1e53a42c Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/1830581 Reviewed-by: svc-misra-checker Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit 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 | 4 ++-- drivers/gpu/nvgpu/gp10b/hal_gp10b.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (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 68dfcfe4..1050c89f 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -88,9 +88,9 @@ #include #include -int gp10b_get_litter_value(struct gk20a *g, int value) +u32 gp10b_get_litter_value(struct gk20a *g, int value) { - int ret = EINVAL; + u32 ret = EINVAL; switch (value) { case GPU_LIT_NUM_GPCS: ret = proj_scal_litter_num_gpcs_v(); diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.h b/drivers/gpu/nvgpu/gp10b/hal_gp10b.h index 6ba80b88..13103c17 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.h @@ -27,5 +27,5 @@ struct gk20a; int gp10b_init_hal(struct gk20a *gops); -int gp10b_get_litter_value(struct gk20a *g, int value); +u32 gp10b_get_litter_value(struct gk20a *g, int value); #endif /* NVGPU_HAL_GP10B_H */ -- cgit v1.2.2