diff options
author | Philip Elcan <pelcan@nvidia.com> | 2018-09-18 10:14:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-26 19:44:59 -0400 |
commit | 07e5bd817a23913d120b945ced5c96951716886c (patch) | |
tree | e8654264bba5a5f5a318c587758b7a476b83c0f2 /drivers/gpu/nvgpu/gm20b | |
parent | 1a3d75790db3effe6f461ca4923cac7e7d2202c4 (diff) |
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 <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1830581
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 427403e3..82a510e9 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -71,9 +71,9 @@ | |||
71 | 71 | ||
72 | #define PRIV_SECURITY_DISABLE 0x01 | 72 | #define PRIV_SECURITY_DISABLE 0x01 |
73 | 73 | ||
74 | int gm20b_get_litter_value(struct gk20a *g, int value) | 74 | u32 gm20b_get_litter_value(struct gk20a *g, int value) |
75 | { | 75 | { |
76 | int ret = EINVAL; | 76 | u32 ret = EINVAL; |
77 | switch (value) { | 77 | switch (value) { |
78 | case GPU_LIT_NUM_GPCS: | 78 | case GPU_LIT_NUM_GPCS: |
79 | ret = proj_scal_litter_num_gpcs_v(); | 79 | ret = proj_scal_litter_num_gpcs_v(); |
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.h b/drivers/gpu/nvgpu/gm20b/hal_gm20b.h index 5deb7ef5..ec6b4e96 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.h | |||
@@ -27,5 +27,5 @@ | |||
27 | struct gk20a; | 27 | struct gk20a; |
28 | 28 | ||
29 | int gm20b_init_hal(struct gk20a *g); | 29 | int gm20b_init_hal(struct gk20a *g); |
30 | int gm20b_get_litter_value(struct gk20a *g, int value); | 30 | u32 gm20b_get_litter_value(struct gk20a *g, int value); |
31 | #endif /* NVGPU_GM20B_HAL_GM20B_H */ | 31 | #endif /* NVGPU_GM20B_HAL_GM20B_H */ |