From 7f8226887c28267d3c2351692d4429ead1e17695 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Wed, 29 Aug 2018 15:46:12 -0400 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1810743 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/pmgr/pwrpolicy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pwrpolicy.c') 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, return _pwr_policy_limitarboutputget_helper(p_limit_arb); } -static u32 _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g, +static int _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g, struct boardobj *board_obj_ptr, struct nv_pmu_boardobj *ppmudata) { @@ -190,7 +190,7 @@ static u32 _pwr_domains_pmudatainit_hw_threshold(struct gk20a *g, struct pwr_policy_hw_threshold *p_hw_threshold; struct pwr_policy *p_pwr_policy; struct nv_pmu_pmgr_pwr_policy *pmu_pwr_policy; - u32 status = 0; + int status = 0; status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); if (status) { @@ -256,7 +256,7 @@ static struct boardobj *construct_pwr_policy(struct gk20a *g, void *pargs, u16 pargs_size, u8 type) { struct boardobj *board_obj_ptr = NULL; - u32 status; + int status; struct pwr_policy_hw_threshold *pwrpolicyhwthreshold; struct pwr_policy *pwrpolicy; struct pwr_policy *pwrpolicyparams = (struct pwr_policy*)pargs; @@ -363,13 +363,13 @@ static struct boardobj *construct_pwr_policy(struct gk20a *g, return board_obj_ptr; } -static u32 _pwr_policy_construct_WAR_SW_Threshold_policy(struct gk20a *g, +static int _pwr_policy_construct_WAR_SW_Threshold_policy(struct gk20a *g, struct pmgr_pwr_policy *ppwrpolicyobjs, union pwr_policy_data_union *ppwrpolicydata, u16 pwr_policy_size, u32 obj_index) { - u32 status = 0; + int status = 0; struct boardobj *boardobj; /* WARN policy */ @@ -512,10 +512,10 @@ static inline void devinit_unpack_pwr_policy_entry( __UNPACK_FIELD(unpacked, packed, filter_param); } -static u32 devinit_get_pwr_policy_table(struct gk20a *g, +static int devinit_get_pwr_policy_table(struct gk20a *g, struct pmgr_pwr_policy *ppwrpolicyobjs) { - u32 status = 0; + int status = 0; u8 *ptr = NULL; struct boardobj *boardobj; struct pwr_policy_3x_header_struct *packed_hdr; @@ -707,9 +707,9 @@ done: return status; } -u32 pmgr_policy_sw_setup(struct gk20a *g) +int pmgr_policy_sw_setup(struct gk20a *g) { - u32 status; + int status; struct boardobjgrp *pboardobjgrp = NULL; struct pwr_policy *ppolicy; struct pmgr_pwr_policy *ppwrpolicyobjs; -- cgit v1.2.2