summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pmgr/pwrmonitor.c
diff options
context:
space:
mode:
authorPhilip Elcan <pelcan@nvidia.com>2018-08-29 15:46:12 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-07 00:33:50 -0400
commit7f8226887c28267d3c2351692d4429ead1e17695 (patch)
treeaa09c45e496b058044c9d9a94c94d9922c572285 /drivers/gpu/nvgpu/pmgr/pwrmonitor.c
parent0e58ebaae13dd59b6aba5297f898e7c89fcd2742 (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/pwrmonitor.c')
-rw-r--r--drivers/gpu/nvgpu/pmgr/pwrmonitor.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c
index 5e0cc966..53c7a1c4 100644
--- a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c
+++ b/drivers/gpu/nvgpu/pmgr/pwrmonitor.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
31static u32 _pwr_channel_pmudata_instget(struct gk20a *g, 31static int _pwr_channel_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)
@@ -54,7 +54,7 @@ static u32 _pwr_channel_pmudata_instget(struct gk20a *g,
54 return 0; 54 return 0;
55} 55}
56 56
57static u32 _pwr_channel_rels_pmudata_instget(struct gk20a *g, 57static int _pwr_channel_rels_pmudata_instget(struct gk20a *g,
58 struct nv_pmu_boardobjgrp *pmuboardobjgrp, 58 struct nv_pmu_boardobjgrp *pmuboardobjgrp,
59 struct nv_pmu_boardobj **ppboardobjpmudata, 59 struct nv_pmu_boardobj **ppboardobjpmudata,
60 u8 idx) 60 u8 idx)
@@ -105,13 +105,13 @@ static bool _pwr_channel_implements(struct pwr_channel *pchannel,
105 return (type == BOARDOBJ_GET_TYPE(pchannel)); 105 return (type == BOARDOBJ_GET_TYPE(pchannel));
106} 106}
107 107
108static u32 _pwr_domains_pmudatainit_sensor(struct gk20a *g, 108static int _pwr_domains_pmudatainit_sensor(struct gk20a *g,
109 struct boardobj *board_obj_ptr, 109 struct boardobj *board_obj_ptr,
110 struct nv_pmu_boardobj *ppmudata) 110 struct nv_pmu_boardobj *ppmudata)
111{ 111{
112 struct nv_pmu_pmgr_pwr_channel_sensor *pmu_sensor_data; 112 struct nv_pmu_pmgr_pwr_channel_sensor *pmu_sensor_data;
113 struct pwr_channel_sensor *sensor; 113 struct pwr_channel_sensor *sensor;
114 u32 status = 0; 114 int status = 0;
115 115
116 status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); 116 status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata);
117 if (status) { 117 if (status) {
@@ -144,7 +144,7 @@ static struct boardobj *construct_pwr_topology(struct gk20a *g,
144 void *pargs, u16 pargs_size, u8 type) 144 void *pargs, u16 pargs_size, u8 type)
145{ 145{
146 struct boardobj *board_obj_ptr = NULL; 146 struct boardobj *board_obj_ptr = NULL;
147 u32 status; 147 int status;
148 struct pwr_channel_sensor *pwrchannel; 148 struct pwr_channel_sensor *pwrchannel;
149 struct pwr_channel_sensor *sensor = (struct pwr_channel_sensor*)pargs; 149 struct pwr_channel_sensor *sensor = (struct pwr_channel_sensor*)pargs;
150 150
@@ -174,10 +174,10 @@ static struct boardobj *construct_pwr_topology(struct gk20a *g,
174 return board_obj_ptr; 174 return board_obj_ptr;
175} 175}
176 176
177static u32 devinit_get_pwr_topology_table(struct gk20a *g, 177static int devinit_get_pwr_topology_table(struct gk20a *g,
178 struct pmgr_pwr_monitor *ppwrmonitorobjs) 178 struct pmgr_pwr_monitor *ppwrmonitorobjs)
179{ 179{
180 u32 status = 0; 180 int status = 0;
181 u8 *pwr_topology_table_ptr = NULL; 181 u8 *pwr_topology_table_ptr = NULL;
182 u8 *curr_pwr_topology_table_ptr = NULL; 182 u8 *curr_pwr_topology_table_ptr = NULL;
183 struct boardobj *boardobj; 183 struct boardobj *boardobj;
@@ -296,9 +296,9 @@ done:
296 return status; 296 return status;
297} 297}
298 298
299u32 pmgr_monitor_sw_setup(struct gk20a *g) 299int pmgr_monitor_sw_setup(struct gk20a *g)
300{ 300{
301 u32 status; 301 int status;
302 struct boardobjgrp *pboardobjgrp = NULL; 302 struct boardobjgrp *pboardobjgrp = NULL;
303 struct pwr_channel *pchannel; 303 struct pwr_channel *pchannel;
304 struct pmgr_pwr_monitor *ppwrmonitorobjs; 304 struct pmgr_pwr_monitor *ppwrmonitorobjs;