diff options
author | Philip Elcan <pelcan@nvidia.com> | 2018-08-29 15:46:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-07 00:33:50 -0400 |
commit | 7f8226887c28267d3c2351692d4429ead1e17695 (patch) | |
tree | aa09c45e496b058044c9d9a94c94d9922c572285 /drivers/gpu/nvgpu/pmgr/pwrdev.c | |
parent | 0e58ebaae13dd59b6aba5297f898e7c89fcd2742 (diff) |
gpu: nvgpu: cleanup return types for MISRA 10.3
This is a big cleanup of return types across a number of modules in the
nvgpu driver. Many functions were returning u32 but using negative
return codes. This is a MISRA 10.3 violation by assigning signed values
to a u32.
JIRA NVGPU-647
Change-Id: I59ee66706321f5b5b1a07ed8c24b81583e9ba28c
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1810743
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pwrdev.c')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pwrdev.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pwrdev.c b/drivers/gpu/nvgpu/pmgr/pwrdev.c index da51ac4b..235629d6 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrdev.c +++ b/drivers/gpu/nvgpu/pmgr/pwrdev.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "boardobj/boardobjgrp_e32.h" | 28 | #include "boardobj/boardobjgrp_e32.h" |
29 | #include "gp106/bios_gp106.h" | 29 | #include "gp106/bios_gp106.h" |
30 | 30 | ||
31 | static u32 _pwr_device_pmudata_instget(struct gk20a *g, | 31 | static int _pwr_device_pmudata_instget(struct gk20a *g, |
32 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, | 32 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, |
33 | struct nv_pmu_boardobj **ppboardobjpmudata, | 33 | struct nv_pmu_boardobj **ppboardobjpmudata, |
34 | u8 idx) | 34 | u8 idx) |
@@ -51,13 +51,13 @@ static u32 _pwr_device_pmudata_instget(struct gk20a *g, | |||
51 | return 0; | 51 | return 0; |
52 | } | 52 | } |
53 | 53 | ||
54 | static u32 _pwr_domains_pmudatainit_ina3221(struct gk20a *g, | 54 | static int _pwr_domains_pmudatainit_ina3221(struct gk20a *g, |
55 | struct boardobj *board_obj_ptr, | 55 | struct boardobj *board_obj_ptr, |
56 | struct nv_pmu_boardobj *ppmudata) | 56 | struct nv_pmu_boardobj *ppmudata) |
57 | { | 57 | { |
58 | struct nv_pmu_pmgr_pwr_device_desc_ina3221 *ina3221_desc; | 58 | struct nv_pmu_pmgr_pwr_device_desc_ina3221 *ina3221_desc; |
59 | struct pwr_device_ina3221 *ina3221; | 59 | struct pwr_device_ina3221 *ina3221; |
60 | u32 status = 0; | 60 | int status = 0; |
61 | u32 indx; | 61 | u32 indx; |
62 | 62 | ||
63 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); | 63 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); |
@@ -92,7 +92,7 @@ static struct boardobj *construct_pwr_device(struct gk20a *g, | |||
92 | void *pargs, u16 pargs_size, u8 type) | 92 | void *pargs, u16 pargs_size, u8 type) |
93 | { | 93 | { |
94 | struct boardobj *board_obj_ptr = NULL; | 94 | struct boardobj *board_obj_ptr = NULL; |
95 | u32 status; | 95 | int status; |
96 | u32 indx; | 96 | u32 indx; |
97 | struct pwr_device_ina3221 *pwrdev; | 97 | struct pwr_device_ina3221 *pwrdev; |
98 | struct pwr_device_ina3221 *ina3221 = (struct pwr_device_ina3221*)pargs; | 98 | struct pwr_device_ina3221 *ina3221 = (struct pwr_device_ina3221*)pargs; |
@@ -127,10 +127,10 @@ static struct boardobj *construct_pwr_device(struct gk20a *g, | |||
127 | return board_obj_ptr; | 127 | return board_obj_ptr; |
128 | } | 128 | } |
129 | 129 | ||
130 | static u32 devinit_get_pwr_device_table(struct gk20a *g, | 130 | static int devinit_get_pwr_device_table(struct gk20a *g, |
131 | struct pwr_devices *ppwrdeviceobjs) | 131 | struct pwr_devices *ppwrdeviceobjs) |
132 | { | 132 | { |
133 | u32 status = 0; | 133 | int status = 0; |
134 | u8 *pwr_device_table_ptr = NULL; | 134 | u8 *pwr_device_table_ptr = NULL; |
135 | u8 *curr_pwr_device_table_ptr = NULL; | 135 | u8 *curr_pwr_device_table_ptr = NULL; |
136 | struct boardobj *boardobj; | 136 | struct boardobj *boardobj; |
@@ -284,9 +284,9 @@ done: | |||
284 | return status; | 284 | return status; |
285 | } | 285 | } |
286 | 286 | ||
287 | u32 pmgr_device_sw_setup(struct gk20a *g) | 287 | int pmgr_device_sw_setup(struct gk20a *g) |
288 | { | 288 | { |
289 | u32 status; | 289 | int status; |
290 | struct boardobjgrp *pboardobjgrp = NULL; | 290 | struct boardobjgrp *pboardobjgrp = NULL; |
291 | struct pwr_devices *ppwrdeviceobjs; | 291 | struct pwr_devices *ppwrdeviceobjs; |
292 | 292 | ||