summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/boardobj/boardobjgrp.h
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/boardobj/boardobjgrp.h
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/boardobj/boardobjgrp.h')
-rw-r--r--drivers/gpu/nvgpu/boardobj/boardobjgrp.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp.h b/drivers/gpu/nvgpu/boardobj/boardobjgrp.h
index 8fc7136f..625e7912 100644
--- a/drivers/gpu/nvgpu/boardobj/boardobjgrp.h
+++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp.h
@@ -40,13 +40,13 @@ struct pmu_surface;
40* Board Object Group destructor. 40* Board Object Group destructor.
41* 41*
42*/ 42*/
43typedef u32 boardobjgrp_destruct(struct boardobjgrp *pboardobjgrp); 43typedef int boardobjgrp_destruct(struct boardobjgrp *pboardobjgrp);
44 44
45/* 45/*
46* Inserts a previously constructed Board Object into a Board Object Group for 46* Inserts a previously constructed Board Object into a Board Object Group for
47* tracking. Objects are inserted in the array based on the given index. 47* tracking. Objects are inserted in the array based on the given index.
48*/ 48*/
49typedef u32 boardobjgrp_objinsert(struct boardobjgrp *pboardobjgrp, 49typedef int boardobjgrp_objinsert(struct boardobjgrp *pboardobjgrp,
50 struct boardobj *pboardobj, u8 index); 50 struct boardobj *pboardobj, u8 index);
51 51
52/* 52/*
@@ -68,7 +68,7 @@ typedef struct boardobj *boardobjgrp_objgetnext(
68* Board Object Group Remover and destructor. This is used to remove and 68* Board Object Group Remover and destructor. This is used to remove and
69* destruct specific entry from the Board Object Group. 69* destruct specific entry from the Board Object Group.
70*/ 70*/
71typedef u32 boardobjgrp_objremoveanddestroy(struct boardobjgrp *pboardobjgrp, 71typedef int boardobjgrp_objremoveanddestroy(struct boardobjgrp *pboardobjgrp,
72 u8 index); 72 u8 index);
73 73
74/* 74/*
@@ -76,14 +76,14 @@ typedef u32 boardobjgrp_objremoveanddestroy(struct boardobjgrp *pboardobjgrp,
76* for the constructed PMU CMDs, and then sets the object via the 76* for the constructed PMU CMDs, and then sets the object via the
77* PMU_BOARDOBJ_CMD_GRP interface (if constructed). 77* PMU_BOARDOBJ_CMD_GRP interface (if constructed).
78*/ 78*/
79typedef u32 boardobjgrp_pmuinithandle(struct gk20a *g, 79typedef int boardobjgrp_pmuinithandle(struct gk20a *g,
80 struct boardobjgrp *pboardobjGrp); 80 struct boardobjgrp *pboardobjGrp);
81 81
82/* 82/*
83* Fills out the appropriate the PMU_BOARDOBJGRP_<xyz> driver<->PMU description 83* Fills out the appropriate the PMU_BOARDOBJGRP_<xyz> driver<->PMU description
84* header structure, more specifically a mask of BOARDOBJs. 84* header structure, more specifically a mask of BOARDOBJs.
85*/ 85*/
86typedef u32 boardobjgrp_pmuhdrdatainit(struct gk20a *g, 86typedef int boardobjgrp_pmuhdrdatainit(struct gk20a *g,
87 struct boardobjgrp *pboardobjgrp, 87 struct boardobjgrp *pboardobjgrp,
88 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu, 88 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu,
89 struct boardobjgrpmask *mask); 89 struct boardobjgrpmask *mask);
@@ -92,7 +92,7 @@ typedef u32 boardobjgrp_pmuhdrdatainit(struct gk20a *g,
92* Fills out the appropriate the PMU_BOARDOBJGRP_<xyz> driver->PMU description 92* Fills out the appropriate the PMU_BOARDOBJGRP_<xyz> driver->PMU description
93* structure, describing the BOARDOBJGRP and all of its BOARDOBJs to the PMU. 93* structure, describing the BOARDOBJGRP and all of its BOARDOBJs to the PMU.
94*/ 94*/
95typedef u32 boardobjgrp_pmudatainit(struct gk20a *g, 95typedef int boardobjgrp_pmudatainit(struct gk20a *g,
96 struct boardobjgrp *pboardobjgrp, 96 struct boardobjgrp *pboardobjgrp,
97 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu); 97 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu);
98 98
@@ -101,22 +101,22 @@ typedef u32 boardobjgrp_pmudatainit(struct gk20a *g,
101* This interface leverages @ref boardobjgrp_pmudatainit to populate the 101* This interface leverages @ref boardobjgrp_pmudatainit to populate the
102* structure. 102* structure.
103*/ 103*/
104typedef u32 boardobjgrp_pmuset(struct gk20a *g, 104typedef int boardobjgrp_pmuset(struct gk20a *g,
105 struct boardobjgrp *pboardobjgrp); 105 struct boardobjgrp *pboardobjgrp);
106 106
107/* 107/*
108* Gets the dynamic status of the PMU BOARDOBJGRP via the 108* Gets the dynamic status of the PMU BOARDOBJGRP via the
109* PMU_BOARDOBJ_CMD_GRP GET_STATUS interface. 109* PMU_BOARDOBJ_CMD_GRP GET_STATUS interface.
110*/ 110*/
111typedef u32 boardobjgrp_pmugetstatus(struct gk20a *g, 111typedef int boardobjgrp_pmugetstatus(struct gk20a *g,
112 struct boardobjgrp *pboardobjgrp, 112 struct boardobjgrp *pboardobjgrp,
113 struct boardobjgrpmask *mask); 113 struct boardobjgrpmask *mask);
114 114
115typedef u32 boardobjgrp_pmudatainstget(struct gk20a *g, 115typedef int boardobjgrp_pmudatainstget(struct gk20a *g,
116 struct nv_pmu_boardobjgrp *boardobjgrppmu, 116 struct nv_pmu_boardobjgrp *boardobjgrppmu,
117 struct nv_pmu_boardobj **ppboardobjpmudata, u8 idx); 117 struct nv_pmu_boardobj **ppboardobjpmudata, u8 idx);
118 118
119typedef u32 boardobjgrp_pmustatusinstget(struct gk20a *g, void *pboardobjgrppmu, 119typedef int boardobjgrp_pmustatusinstget(struct gk20a *g, void *pboardobjgrppmu,
120 struct nv_pmu_boardobj_query **ppBoardobjpmustatus, u8 idx); 120 struct nv_pmu_boardobj_query **ppBoardobjpmustatus, u8 idx);
121 121
122/* 122/*
@@ -153,7 +153,7 @@ struct boardobjgrp_pmu {
153* CMD. This provides the various information describing the PMU CMD including 153* CMD. This provides the various information describing the PMU CMD including
154* the CMD and MSG ID and the size of the various sturctures in the payload. 154* the CMD and MSG ID and the size of the various sturctures in the payload.
155*/ 155*/
156typedef u32 boardobjgrp_pmucmd_construct(struct gk20a *g, 156typedef int boardobjgrp_pmucmd_construct(struct gk20a *g,
157 struct boardobjgrp *pboardobjgrp, 157 struct boardobjgrp *pboardobjgrp,
158 struct boardobjgrp_pmu_cmd *cmd, u8 id, u8 msgid, 158 struct boardobjgrp_pmu_cmd *cmd, u8 id, u8 msgid,
159 u8 hdrsize, u8 entrysize, u16 fbsize, u32 ss_offset, u8 rpc_func_id); 159 u8 hdrsize, u8 entrysize, u16 fbsize, u32 ss_offset, u8 rpc_func_id);
@@ -161,7 +161,7 @@ typedef u32 boardobjgrp_pmucmd_construct(struct gk20a *g,
161/* 161/*
162* Destroys BOARDOBJGRP PMU SW state. CMD. 162* Destroys BOARDOBJGRP PMU SW state. CMD.
163*/ 163*/
164typedef u32 boardobjgrp_pmucmd_destroy(struct gk20a *g, 164typedef int boardobjgrp_pmucmd_destroy(struct gk20a *g,
165 struct boardobjgrp_pmu_cmd *cmd); 165 struct boardobjgrp_pmu_cmd *cmd);
166 166
167/* 167/*
@@ -169,7 +169,7 @@ typedef u32 boardobjgrp_pmucmd_destroy(struct gk20a *g,
169* PMU CMD payload within both the PMU and driver so that it can be referenced 169* PMU CMD payload within both the PMU and driver so that it can be referenced
170* at run-time. 170* at run-time.
171*/ 171*/
172typedef u32 boardobjgrp_pmucmd_pmuinithandle(struct gk20a *g, 172typedef int boardobjgrp_pmucmd_pmuinithandle(struct gk20a *g,
173 struct boardobjgrp *pboardobjgrp, 173 struct boardobjgrp *pboardobjgrp,
174 struct boardobjgrp_pmu_cmd *cmd); 174 struct boardobjgrp_pmu_cmd *cmd);
175 175
@@ -352,7 +352,8 @@ do { \
352 352
353/* ------------------------ Function Prototypes ----------------------------- */ 353/* ------------------------ Function Prototypes ----------------------------- */
354/* Constructor and destructor */ 354/* Constructor and destructor */
355u32 boardobjgrp_construct_super(struct gk20a *g, struct boardobjgrp *pboardobjgrp); 355int boardobjgrp_construct_super(struct gk20a *g,
356 struct boardobjgrp *pboardobjgrp);
356boardobjgrp_destruct boardobjgrp_destruct_impl; 357boardobjgrp_destruct boardobjgrp_destruct_impl;
357boardobjgrp_destruct boardobjgrp_destruct_super; 358boardobjgrp_destruct boardobjgrp_destruct_super;
358 359