diff options
author | Srirangan <smadhavan@nvidia.com> | 2018-08-27 01:59:01 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-29 11:59:35 -0400 |
commit | e3710e5431d8f14f1b8c2812f5c1aeeb7bdaac1c (patch) | |
tree | 8a6498b12e10f6b391d3c5dd7c6ac7b340ca60b4 /drivers/gpu/nvgpu/gp106/pmu_gp106.c | |
parent | 2f97e683feed3c3ba3c8722c4f6ab7466bcef0c0 (diff) |
gpu: nvgpu: gp106: 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, introducing the braces.
JIRA NVGPU-671
Change-Id: I8493274995ed8de526902dd0ca0808b2972e28aa
Signed-off-by: Srirangan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1796806
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@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/gp106/pmu_gp106.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_gp106.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index 45924828..963668c4 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c | |||
@@ -54,8 +54,9 @@ bool gp106_pmu_is_engine_in_reset(struct gk20a *g) | |||
54 | bool status = false; | 54 | bool status = false; |
55 | 55 | ||
56 | reg_reset = gk20a_readl(g, pwr_falcon_engine_r()); | 56 | reg_reset = gk20a_readl(g, pwr_falcon_engine_r()); |
57 | if (reg_reset == pwr_falcon_engine_reset_true_f()) | 57 | if (reg_reset == pwr_falcon_engine_reset_true_f()) { |
58 | status = true; | 58 | status = true; |
59 | } | ||
59 | 60 | ||
60 | return status; | 61 | return status; |
61 | } | 62 | } |
@@ -82,11 +83,13 @@ int gp106_pmu_engine_reset(struct gk20a *g, bool do_reset) | |||
82 | 83 | ||
83 | u32 gp106_pmu_pg_feature_list(struct gk20a *g, u32 pg_engine_id) | 84 | u32 gp106_pmu_pg_feature_list(struct gk20a *g, u32 pg_engine_id) |
84 | { | 85 | { |
85 | if (pg_engine_id == PMU_PG_ELPG_ENGINE_ID_GRAPHICS) | 86 | if (pg_engine_id == PMU_PG_ELPG_ENGINE_ID_GRAPHICS) { |
86 | return NVGPU_PMU_GR_FEATURE_MASK_RPPG; | 87 | return NVGPU_PMU_GR_FEATURE_MASK_RPPG; |
88 | } | ||
87 | 89 | ||
88 | if (pg_engine_id == PMU_PG_ELPG_ENGINE_ID_MS) | 90 | if (pg_engine_id == PMU_PG_ELPG_ENGINE_ID_MS) { |
89 | return NVGPU_PMU_MS_FEATURE_MASK_ALL; | 91 | return NVGPU_PMU_MS_FEATURE_MASK_ALL; |
92 | } | ||
90 | 93 | ||
91 | return 0; | 94 | return 0; |
92 | } | 95 | } |
@@ -274,11 +277,13 @@ int gp106_load_falcon_ucode(struct gk20a *g, u32 falconidmask) | |||
274 | u32 flags = PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_YES; | 277 | u32 flags = PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_YES; |
275 | 278 | ||
276 | /* GM20B PMU supports loading FECS and GPCCS only */ | 279 | /* GM20B PMU supports loading FECS and GPCCS only */ |
277 | if (falconidmask == 0) | 280 | if (falconidmask == 0) { |
278 | return -EINVAL; | 281 | return -EINVAL; |
282 | } | ||
279 | if (falconidmask & ~((1 << LSF_FALCON_ID_FECS) | | 283 | if (falconidmask & ~((1 << LSF_FALCON_ID_FECS) | |
280 | (1 << LSF_FALCON_ID_GPCCS))) | 284 | (1 << LSF_FALCON_ID_GPCCS))) { |
281 | return -EINVAL; | 285 | return -EINVAL; |
286 | } | ||
282 | g->pmu_lsf_loaded_falcon_id = 0; | 287 | g->pmu_lsf_loaded_falcon_id = 0; |
283 | /* check whether pmu is ready to bootstrap lsf if not wait for it */ | 288 | /* check whether pmu is ready to bootstrap lsf if not wait for it */ |
284 | if (!g->pmu_lsf_pmu_wpr_init_done) { | 289 | if (!g->pmu_lsf_pmu_wpr_init_done) { |
@@ -296,7 +301,8 @@ int gp106_load_falcon_ucode(struct gk20a *g, u32 falconidmask) | |||
296 | pmu_wait_message_cond(&g->pmu, | 301 | pmu_wait_message_cond(&g->pmu, |
297 | gk20a_get_gr_idle_timeout(g), | 302 | gk20a_get_gr_idle_timeout(g), |
298 | &g->pmu_lsf_loaded_falcon_id, falconidmask); | 303 | &g->pmu_lsf_loaded_falcon_id, falconidmask); |
299 | if (g->pmu_lsf_loaded_falcon_id != falconidmask) | 304 | if (g->pmu_lsf_loaded_falcon_id != falconidmask) { |
300 | return -ETIMEDOUT; | 305 | return -ETIMEDOUT; |
306 | } | ||
301 | return 0; | 307 | return 0; |
302 | } | 308 | } |