diff options
author | Srirangan <smadhavan@nvidia.com> | 2018-09-04 06:46:20 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-05 23:38:33 -0400 |
commit | ef851272e5201f343c9b287a9eacfc25d4912276 (patch) | |
tree | 2c7f85f168258e8b8779dd3ef32f1b18621fa6a7 /drivers/gpu/nvgpu/clk/clk_vf_point.c | |
parent | 78b4ab269f5d733c8b540a6a75db1f390172cc29 (diff) |
gpu: nvgpu: clk: Fix MISRA 15.6 violations
MISRA Rule-15.6 requires that all if-else blocks be enclosed in braces,
including single statement blocks. Fix errors due to single statement
if blocks without braces by introducing the braces.
JIRA NVGPU-671
Change-Id: I228f04adea809e1dd4e6826bf1a04f051a533102
Signed-off-by: Srirangan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1796831
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_vf_point.c')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_vf_point.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_vf_point.c b/drivers/gpu/nvgpu/clk/clk_vf_point.c index b459c012..5fc1d8e5 100644 --- a/drivers/gpu/nvgpu/clk/clk_vf_point.c +++ b/drivers/gpu/nvgpu/clk/clk_vf_point.c | |||
@@ -62,8 +62,9 @@ static u32 _clk_vf_points_pmudata_instget(struct gk20a *g, | |||
62 | nvgpu_log_info(g, " "); | 62 | nvgpu_log_info(g, " "); |
63 | 63 | ||
64 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ | 64 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ |
65 | if (idx >= CTRL_BOARDOBJGRP_E255_MAX_OBJECTS) | 65 | if (idx >= CTRL_BOARDOBJGRP_E255_MAX_OBJECTS) { |
66 | return -EINVAL; | 66 | return -EINVAL; |
67 | } | ||
67 | 68 | ||
68 | *ppboardobjpmudata = (struct nv_pmu_boardobj *) | 69 | *ppboardobjpmudata = (struct nv_pmu_boardobj *) |
69 | &pgrp_set->objects[idx].data.board_obj; | 70 | &pgrp_set->objects[idx].data.board_obj; |
@@ -81,8 +82,9 @@ static u32 _clk_vf_points_pmustatus_instget(struct gk20a *g, | |||
81 | pboardobjgrppmu; | 82 | pboardobjgrppmu; |
82 | 83 | ||
83 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ | 84 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ |
84 | if (idx >= CTRL_BOARDOBJGRP_E255_MAX_OBJECTS) | 85 | if (idx >= CTRL_BOARDOBJGRP_E255_MAX_OBJECTS) { |
85 | return -EINVAL; | 86 | return -EINVAL; |
87 | } | ||
86 | 88 | ||
87 | *ppboardobjpmustatus = (struct nv_pmu_boardobj_query *) | 89 | *ppboardobjpmustatus = (struct nv_pmu_boardobj_query *) |
88 | &pgrp_get_status->objects[idx].data.board_obj; | 90 | &pgrp_get_status->objects[idx].data.board_obj; |
@@ -145,8 +147,9 @@ u32 clk_vf_point_pmu_setup(struct gk20a *g) | |||
145 | 147 | ||
146 | pboardobjgrp = &g->clk_pmu.clk_vf_pointobjs.super.super; | 148 | pboardobjgrp = &g->clk_pmu.clk_vf_pointobjs.super.super; |
147 | 149 | ||
148 | if (!pboardobjgrp->bconstructed) | 150 | if (!pboardobjgrp->bconstructed) { |
149 | return -EINVAL; | 151 | return -EINVAL; |
152 | } | ||
150 | 153 | ||
151 | status = pboardobjgrp->pmuinithandle(g, pboardobjgrp); | 154 | status = pboardobjgrp->pmuinithandle(g, pboardobjgrp); |
152 | 155 | ||
@@ -165,8 +168,9 @@ static u32 clk_vf_point_construct_super(struct gk20a *g, | |||
165 | 168 | ||
166 | status = boardobj_construct_super(g, ppboardobj, | 169 | status = boardobj_construct_super(g, ppboardobj, |
167 | size, pargs); | 170 | size, pargs); |
168 | if (status) | 171 | if (status) { |
169 | return -EINVAL; | 172 | return -EINVAL; |
173 | } | ||
170 | 174 | ||
171 | pclkvfpoint = (struct clk_vf_point *)*ppboardobj; | 175 | pclkvfpoint = (struct clk_vf_point *)*ppboardobj; |
172 | 176 | ||
@@ -190,8 +194,9 @@ static u32 _clk_vf_point_pmudatainit_volt(struct gk20a *g, | |||
190 | nvgpu_log_info(g, " "); | 194 | nvgpu_log_info(g, " "); |
191 | 195 | ||
192 | status = _clk_vf_point_pmudatainit_super(g, board_obj_ptr, ppmudata); | 196 | status = _clk_vf_point_pmudatainit_super(g, board_obj_ptr, ppmudata); |
193 | if (status != 0) | 197 | if (status != 0) { |
194 | return status; | 198 | return status; |
199 | } | ||
195 | 200 | ||
196 | pclk_vf_point_volt = | 201 | pclk_vf_point_volt = |
197 | (struct clk_vf_point_volt *)board_obj_ptr; | 202 | (struct clk_vf_point_volt *)board_obj_ptr; |
@@ -217,8 +222,9 @@ static u32 _clk_vf_point_pmudatainit_freq(struct gk20a *g, | |||
217 | nvgpu_log_info(g, " "); | 222 | nvgpu_log_info(g, " "); |
218 | 223 | ||
219 | status = _clk_vf_point_pmudatainit_super(g, board_obj_ptr, ppmudata); | 224 | status = _clk_vf_point_pmudatainit_super(g, board_obj_ptr, ppmudata); |
220 | if (status != 0) | 225 | if (status != 0) { |
221 | return status; | 226 | return status; |
227 | } | ||
222 | 228 | ||
223 | pclk_vf_point_freq = | 229 | pclk_vf_point_freq = |
224 | (struct clk_vf_point_freq *)board_obj_ptr; | 230 | (struct clk_vf_point_freq *)board_obj_ptr; |
@@ -244,13 +250,15 @@ static u32 clk_vf_point_construct_volt(struct gk20a *g, | |||
244 | (struct clk_vf_point_volt *)pargs; | 250 | (struct clk_vf_point_volt *)pargs; |
245 | u32 status = 0; | 251 | u32 status = 0; |
246 | 252 | ||
247 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_CLK_VF_POINT_TYPE_VOLT) | 253 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_CLK_VF_POINT_TYPE_VOLT) { |
248 | return -EINVAL; | 254 | return -EINVAL; |
255 | } | ||
249 | 256 | ||
250 | ptmpobj->type_mask = BIT(CTRL_CLK_CLK_VF_POINT_TYPE_VOLT); | 257 | ptmpobj->type_mask = BIT(CTRL_CLK_CLK_VF_POINT_TYPE_VOLT); |
251 | status = clk_vf_point_construct_super(g, ppboardobj, size, pargs); | 258 | status = clk_vf_point_construct_super(g, ppboardobj, size, pargs); |
252 | if (status) | 259 | if (status) { |
253 | return -EINVAL; | 260 | return -EINVAL; |
261 | } | ||
254 | 262 | ||
255 | pclkvfpoint = (struct clk_vf_point_volt *)*ppboardobj; | 263 | pclkvfpoint = (struct clk_vf_point_volt *)*ppboardobj; |
256 | 264 | ||
@@ -273,13 +281,15 @@ static u32 clk_vf_point_construct_freq(struct gk20a *g, | |||
273 | (struct clk_vf_point_freq *)pargs; | 281 | (struct clk_vf_point_freq *)pargs; |
274 | u32 status = 0; | 282 | u32 status = 0; |
275 | 283 | ||
276 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_CLK_VF_POINT_TYPE_FREQ) | 284 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_CLK_VF_POINT_TYPE_FREQ) { |
277 | return -EINVAL; | 285 | return -EINVAL; |
286 | } | ||
278 | 287 | ||
279 | ptmpobj->type_mask = BIT(CTRL_CLK_CLK_VF_POINT_TYPE_FREQ); | 288 | ptmpobj->type_mask = BIT(CTRL_CLK_CLK_VF_POINT_TYPE_FREQ); |
280 | status = clk_vf_point_construct_super(g, ppboardobj, size, pargs); | 289 | status = clk_vf_point_construct_super(g, ppboardobj, size, pargs); |
281 | if (status) | 290 | if (status) { |
282 | return -EINVAL; | 291 | return -EINVAL; |
292 | } | ||
283 | 293 | ||
284 | pclkvfpoint = (struct clk_vf_point_freq *)*ppboardobj; | 294 | pclkvfpoint = (struct clk_vf_point_freq *)*ppboardobj; |
285 | 295 | ||
@@ -313,8 +323,9 @@ struct clk_vf_point *construct_clk_vf_point(struct gk20a *g, void *pargs) | |||
313 | return NULL; | 323 | return NULL; |
314 | } | 324 | } |
315 | 325 | ||
316 | if (status) | 326 | if (status) { |
317 | return NULL; | 327 | return NULL; |
328 | } | ||
318 | 329 | ||
319 | nvgpu_log_info(g, " Done"); | 330 | nvgpu_log_info(g, " Done"); |
320 | 331 | ||
@@ -332,8 +343,9 @@ static u32 _clk_vf_point_pmudatainit_super(struct gk20a *g, | |||
332 | nvgpu_log_info(g, " "); | 343 | nvgpu_log_info(g, " "); |
333 | 344 | ||
334 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); | 345 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); |
335 | if (status != 0) | 346 | if (status != 0) { |
336 | return status; | 347 | return status; |
348 | } | ||
337 | 349 | ||
338 | pclk_vf_point = | 350 | pclk_vf_point = |
339 | (struct clk_vf_point *)board_obj_ptr; | 351 | (struct clk_vf_point *)board_obj_ptr; |