summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pmgr/pwrpolicy.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/pwrpolicy.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/pwrpolicy.c')
-rw-r--r--drivers/gpu/nvgpu/pmgr/pwrpolicy.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
index 38575f74..13a94e4f 100644
--- a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
+++ b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
@@ -182,7 +182,7 @@ static u32 _pwr_policy_limitarboutputget(struct gk20a *g,
182 return _pwr_policy_limitarboutputget_helper(p_limit_arb); 182 return _pwr_policy_limitarboutputget_helper(p_limit_arb);
183} 183}
184 184
185static u32 _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g, 185static int _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g,
186 struct boardobj *board_obj_ptr, 186 struct boardobj *board_obj_ptr,
187 struct nv_pmu_boardobj *ppmudata) 187 struct nv_pmu_boardobj *ppmudata)
188{ 188{
@@ -190,7 +190,7 @@ static u32 _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g,
190 struct pwr_policy_hw_threshold *p_hw_threshold; 190 struct pwr_policy_hw_threshold *p_hw_threshold;
191 struct pwr_policy *p_pwr_policy; 191 struct pwr_policy *p_pwr_policy;
192 struct nv_pmu_pmgr_pwr_policy *pmu_pwr_policy; 192 struct nv_pmu_pmgr_pwr_policy *pmu_pwr_policy;
193 u32 status = 0; 193 int status = 0;
194 194
195 status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); 195 status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata);
196 if (status) { 196 if (status) {
@@ -256,7 +256,7 @@ static struct boardobj *construct_pwr_policy(struct gk20a *g,
256 void *pargs, u16 pargs_size, u8 type) 256 void *pargs, u16 pargs_size, u8 type)
257{ 257{
258 struct boardobj *board_obj_ptr = NULL; 258 struct boardobj *board_obj_ptr = NULL;
259 u32 status; 259 int status;
260 struct pwr_policy_hw_threshold *pwrpolicyhwthreshold; 260 struct pwr_policy_hw_threshold *pwrpolicyhwthreshold;
261 struct pwr_policy *pwrpolicy; 261 struct pwr_policy *pwrpolicy;
262 struct pwr_policy *pwrpolicyparams = (struct pwr_policy*)pargs; 262 struct pwr_policy *pwrpolicyparams = (struct pwr_policy*)pargs;
@@ -363,13 +363,13 @@ static struct boardobj *construct_pwr_policy(struct gk20a *g,
363 return board_obj_ptr; 363 return board_obj_ptr;
364} 364}
365 365
366static u32 _pwr_policy_construct_WAR_SW_Threshold_policy(struct gk20a *g, 366static int _pwr_policy_construct_WAR_SW_Threshold_policy(struct gk20a *g,
367 struct pmgr_pwr_policy *ppwrpolicyobjs, 367 struct pmgr_pwr_policy *ppwrpolicyobjs,
368 union pwr_policy_data_union *ppwrpolicydata, 368 union pwr_policy_data_union *ppwrpolicydata,
369 u16 pwr_policy_size, 369 u16 pwr_policy_size,
370 u32 obj_index) 370 u32 obj_index)
371{ 371{
372 u32 status = 0; 372 int status = 0;
373 struct boardobj *boardobj; 373 struct boardobj *boardobj;
374 374
375 /* WARN policy */ 375 /* WARN policy */
@@ -512,10 +512,10 @@ static inline void devinit_unpack_pwr_policy_entry(
512 __UNPACK_FIELD(unpacked, packed, filter_param); 512 __UNPACK_FIELD(unpacked, packed, filter_param);
513} 513}
514 514
515static u32 devinit_get_pwr_policy_table(struct gk20a *g, 515static int devinit_get_pwr_policy_table(struct gk20a *g,
516 struct pmgr_pwr_policy *ppwrpolicyobjs) 516 struct pmgr_pwr_policy *ppwrpolicyobjs)
517{ 517{
518 u32 status = 0; 518 int status = 0;
519 u8 *ptr = NULL; 519 u8 *ptr = NULL;
520 struct boardobj *boardobj; 520 struct boardobj *boardobj;
521 struct pwr_policy_3x_header_struct *packed_hdr; 521 struct pwr_policy_3x_header_struct *packed_hdr;
@@ -707,9 +707,9 @@ done:
707 return status; 707 return status;
708} 708}
709 709
710u32 pmgr_policy_sw_setup(struct gk20a *g) 710int pmgr_policy_sw_setup(struct gk20a *g)
711{ 711{
712 u32 status; 712 int status;
713 struct boardobjgrp *pboardobjgrp = NULL; 713 struct boardobjgrp *pboardobjgrp = NULL;
714 struct pwr_policy *ppolicy; 714 struct pwr_policy *ppolicy;
715 struct pmgr_pwr_policy *ppwrpolicyobjs; 715 struct pmgr_pwr_policy *ppwrpolicyobjs;