summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/clk_gp106.c
diff options
context:
space:
mode:
authorSrirangan <smadhavan@nvidia.com>2018-08-27 01:59:01 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-29 11:59:35 -0400
commite3710e5431d8f14f1b8c2812f5c1aeeb7bdaac1c (patch)
tree8a6498b12e10f6b391d3c5dd7c6ac7b340ca60b4 /drivers/gpu/nvgpu/gp106/clk_gp106.c
parent2f97e683feed3c3ba3c8722c4f6ab7466bcef0c0 (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/clk_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index e3633b58..24b07112 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -68,8 +68,9 @@ unsigned long gp106_clk_measure_freq(struct gk20a *g, u32 api_domain)
68 } 68 }
69 } 69 }
70 70
71 if (!c) 71 if (!c) {
72 return 0; 72 return 0;
73 }
73 74
74 freq_khz = c->is_counter ? c->scale * gp106_get_rate_cntr(g, c) : 75 freq_khz = c->is_counter ? c->scale * gp106_get_rate_cntr(g, c) :
75 0; /* TODO: PLL read */ 76 0; /* TODO: PLL read */
@@ -86,8 +87,9 @@ int gp106_init_clk_support(struct gk20a *g)
86 nvgpu_log_fn(g, " "); 87 nvgpu_log_fn(g, " ");
87 88
88 err = nvgpu_mutex_init(&clk->clk_mutex); 89 err = nvgpu_mutex_init(&clk->clk_mutex);
89 if (err) 90 if (err) {
90 return err; 91 return err;
92 }
91 93
92 clk->clk_namemap = (struct namemap_cfg *) 94 clk->clk_namemap = (struct namemap_cfg *)
93 nvgpu_kzalloc(g, sizeof(struct namemap_cfg) * NUM_NAMEMAPS); 95 nvgpu_kzalloc(g, sizeof(struct namemap_cfg) * NUM_NAMEMAPS);
@@ -185,8 +187,9 @@ static u32 gp106_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c) {
185 187
186 struct clk_gk20a *clk = &g->clk; 188 struct clk_gk20a *clk = &g->clk;
187 189
188 if (!c || !c->cntr.reg_ctrl_addr || !c->cntr.reg_cntr_addr) 190 if (!c || !c->cntr.reg_ctrl_addr || !c->cntr.reg_cntr_addr) {
189 return 0; 191 return 0;
192 }
190 193
191 nvgpu_mutex_acquire(&clk->clk_mutex); 194 nvgpu_mutex_acquire(&clk->clk_mutex);
192 195