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/therm/thrmdev.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/therm/thrmdev.c')
-rw-r--r-- | drivers/gpu/nvgpu/therm/thrmdev.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/therm/thrmdev.c b/drivers/gpu/nvgpu/therm/thrmdev.c index aaf0a461..ddd1f280 100644 --- a/drivers/gpu/nvgpu/therm/thrmdev.c +++ b/drivers/gpu/nvgpu/therm/thrmdev.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "gp106/bios_gp106.h" | 30 | #include "gp106/bios_gp106.h" |
31 | #include "ctrl/ctrltherm.h" | 31 | #include "ctrl/ctrltherm.h" |
32 | 32 | ||
33 | static u32 _therm_device_pmudata_instget(struct gk20a *g, | 33 | static int _therm_device_pmudata_instget(struct gk20a *g, |
34 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, | 34 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, |
35 | struct nv_pmu_boardobj **ppboardobjpmudata, | 35 | struct nv_pmu_boardobj **ppboardobjpmudata, |
36 | u8 idx) | 36 | u8 idx) |
@@ -54,29 +54,29 @@ static u32 _therm_device_pmudata_instget(struct gk20a *g, | |||
54 | return 0; | 54 | return 0; |
55 | } | 55 | } |
56 | 56 | ||
57 | static u32 construct_therm_device(struct gk20a *g, | 57 | static int construct_therm_device(struct gk20a *g, |
58 | struct boardobj **ppboardobj, u16 size, void *pargs) | 58 | struct boardobj **ppboardobj, u16 size, void *pargs) |
59 | { | 59 | { |
60 | return boardobj_construct_super(g, ppboardobj, size, pargs); | 60 | return boardobj_construct_super(g, ppboardobj, size, pargs); |
61 | } | 61 | } |
62 | 62 | ||
63 | static u32 construct_therm_device_gpu(struct gk20a *g, | 63 | static int construct_therm_device_gpu(struct gk20a *g, |
64 | struct boardobj **ppboardobj, u16 size, void *pargs) | 64 | struct boardobj **ppboardobj, u16 size, void *pargs) |
65 | { | 65 | { |
66 | return construct_therm_device(g, ppboardobj, size, pargs); | 66 | return construct_therm_device(g, ppboardobj, size, pargs); |
67 | } | 67 | } |
68 | 68 | ||
69 | static u32 construct_therm_device_gpu_sci(struct gk20a *g, | 69 | static int construct_therm_device_gpu_sci(struct gk20a *g, |
70 | struct boardobj **ppboardobj, u16 size, void *pargs) | 70 | struct boardobj **ppboardobj, u16 size, void *pargs) |
71 | { | 71 | { |
72 | return construct_therm_device(g, ppboardobj, size, pargs); | 72 | return construct_therm_device(g, ppboardobj, size, pargs); |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | static u32 therm_device_pmu_data_init_gpu_gpc_tsosc(struct gk20a *g, | 76 | static int therm_device_pmu_data_init_gpu_gpc_tsosc(struct gk20a *g, |
77 | struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata) | 77 | struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata) |
78 | { | 78 | { |
79 | u32 status = 0; | 79 | int status = 0; |
80 | struct therm_device_gpu_gpc_tsosc *pdev = NULL; | 80 | struct therm_device_gpu_gpc_tsosc *pdev = NULL; |
81 | struct nv_pmu_therm_therm_device_gpu_gpc_tsosc_boardobj_set *pset; | 81 | struct nv_pmu_therm_therm_device_gpu_gpc_tsosc_boardobj_set *pset; |
82 | 82 | ||
@@ -95,13 +95,13 @@ exit: | |||
95 | return status; | 95 | return status; |
96 | } | 96 | } |
97 | 97 | ||
98 | static u32 construct_therm_device_gpu_tsosc(struct gk20a *g, | 98 | static int construct_therm_device_gpu_tsosc(struct gk20a *g, |
99 | struct boardobj **ppboardobj, u16 size, void *pargs) | 99 | struct boardobj **ppboardobj, u16 size, void *pargs) |
100 | { | 100 | { |
101 | struct therm_device_gpu_gpc_tsosc *pdev = NULL; | 101 | struct therm_device_gpu_gpc_tsosc *pdev = NULL; |
102 | struct therm_device_gpu_gpc_tsosc *ptmp_dev = | 102 | struct therm_device_gpu_gpc_tsosc *ptmp_dev = |
103 | (struct therm_device_gpu_gpc_tsosc *)pargs; | 103 | (struct therm_device_gpu_gpc_tsosc *)pargs; |
104 | u32 status = 0; | 104 | int status = 0; |
105 | 105 | ||
106 | status = construct_therm_device(g, ppboardobj, size, pargs); | 106 | status = construct_therm_device(g, ppboardobj, size, pargs); |
107 | if (status != 0) { | 107 | if (status != 0) { |
@@ -118,10 +118,10 @@ static u32 construct_therm_device_gpu_tsosc(struct gk20a *g, | |||
118 | return status; | 118 | return status; |
119 | } | 119 | } |
120 | 120 | ||
121 | static u32 therm_device_pmu_data_init_hbm2_site(struct gk20a *g, | 121 | static int therm_device_pmu_data_init_hbm2_site(struct gk20a *g, |
122 | struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata) | 122 | struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata) |
123 | { | 123 | { |
124 | u32 status = 0; | 124 | int status = 0; |
125 | struct therm_device_hbm2_site *pdev = NULL; | 125 | struct therm_device_hbm2_site *pdev = NULL; |
126 | struct nv_pmu_therm_therm_device_hbm2_site_boardobj_set *pset; | 126 | struct nv_pmu_therm_therm_device_hbm2_site_boardobj_set *pset; |
127 | 127 | ||
@@ -140,13 +140,13 @@ exit: | |||
140 | return status; | 140 | return status; |
141 | } | 141 | } |
142 | 142 | ||
143 | static u32 construct_therm_device_hbm2_site(struct gk20a *g, | 143 | static int construct_therm_device_hbm2_site(struct gk20a *g, |
144 | struct boardobj **ppboardobj, u16 size, void *pargs) | 144 | struct boardobj **ppboardobj, u16 size, void *pargs) |
145 | { | 145 | { |
146 | struct therm_device_hbm2_site *pdev = NULL; | 146 | struct therm_device_hbm2_site *pdev = NULL; |
147 | struct therm_device_hbm2_site *ptmp_dev = | 147 | struct therm_device_hbm2_site *ptmp_dev = |
148 | (struct therm_device_hbm2_site *)pargs; | 148 | (struct therm_device_hbm2_site *)pargs; |
149 | u32 status = 0; | 149 | int status = 0; |
150 | 150 | ||
151 | status = construct_therm_device(g, ppboardobj, size, pargs); | 151 | status = construct_therm_device(g, ppboardobj, size, pargs); |
152 | if (status != 0) { | 152 | if (status != 0) { |
@@ -163,7 +163,7 @@ static u32 construct_therm_device_hbm2_site(struct gk20a *g, | |||
163 | return status; | 163 | return status; |
164 | } | 164 | } |
165 | 165 | ||
166 | static u32 construct_therm_device_hbm2_combined(struct gk20a *g, | 166 | static int construct_therm_device_hbm2_combined(struct gk20a *g, |
167 | struct boardobj **ppboardobj, u16 size, void *pargs) | 167 | struct boardobj **ppboardobj, u16 size, void *pargs) |
168 | { | 168 | { |
169 | return construct_therm_device(g, ppboardobj, size, pargs); | 169 | return construct_therm_device(g, ppboardobj, size, pargs); |
@@ -174,7 +174,7 @@ static struct boardobj *therm_device_construct(struct gk20a *g, | |||
174 | void *pargs) | 174 | void *pargs) |
175 | { | 175 | { |
176 | struct boardobj *board_obj_ptr = NULL; | 176 | struct boardobj *board_obj_ptr = NULL; |
177 | u32 status = 0; | 177 | int status = 0; |
178 | 178 | ||
179 | switch (BOARDOBJ_GET_TYPE(pargs)) { | 179 | switch (BOARDOBJ_GET_TYPE(pargs)) { |
180 | case NV_VBIOS_THERM_DEVICE_1X_ENTRY_CLASS_GPU: | 180 | case NV_VBIOS_THERM_DEVICE_1X_ENTRY_CLASS_GPU: |
@@ -216,10 +216,10 @@ static struct boardobj *therm_device_construct(struct gk20a *g, | |||
216 | return board_obj_ptr; | 216 | return board_obj_ptr; |
217 | } | 217 | } |
218 | 218 | ||
219 | static u32 devinit_get_therm_device_table(struct gk20a *g, | 219 | static int devinit_get_therm_device_table(struct gk20a *g, |
220 | struct therm_devices *pthermdeviceobjs) | 220 | struct therm_devices *pthermdeviceobjs) |
221 | { | 221 | { |
222 | u32 status = 0; | 222 | int status = 0; |
223 | u8 *therm_device_table_ptr = NULL; | 223 | u8 *therm_device_table_ptr = NULL; |
224 | u8 *curr_therm_device_table_ptr = NULL; | 224 | u8 *curr_therm_device_table_ptr = NULL; |
225 | struct boardobj *boardobj; | 225 | struct boardobj *boardobj; |
@@ -324,9 +324,9 @@ done: | |||
324 | return status; | 324 | return status; |
325 | } | 325 | } |
326 | 326 | ||
327 | u32 therm_device_sw_setup(struct gk20a *g) | 327 | int therm_device_sw_setup(struct gk20a *g) |
328 | { | 328 | { |
329 | u32 status; | 329 | int status; |
330 | struct boardobjgrp *pboardobjgrp = NULL; | 330 | struct boardobjgrp *pboardobjgrp = NULL; |
331 | struct therm_devices *pthermdeviceobjs; | 331 | struct therm_devices *pthermdeviceobjs; |
332 | 332 | ||