From c7a3b6db10900e0aabc29ca7307908875d685036 Mon Sep 17 00:00:00 2001 From: smadhavan Date: Thu, 6 Sep 2018 14:08:00 +0530 Subject: gpu: nvgpu: 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: I8046a09fa7ffc74c3d737ba57132a0a9ae2ff195 Signed-off-by: smadhavan Reviewed-on: https://git-master.nvidia.com/r/1797699 Reviewed-by: svc-misra-checker Reviewed-by: Nitin Kumbhar GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/pmgr/pwrdev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pwrdev.c') diff --git a/drivers/gpu/nvgpu/pmgr/pwrdev.c b/drivers/gpu/nvgpu/pmgr/pwrdev.c index 235629d6..90d39610 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrdev.c +++ b/drivers/gpu/nvgpu/pmgr/pwrdev.c @@ -40,8 +40,9 @@ static int _pwr_device_pmudata_instget(struct gk20a *g, /*check whether pmuboardobjgrp has a valid boardobj in index*/ if (((u32)BIT(idx) & - ppmgrdevice->hdr.data.super.obj_mask.super.data[0]) == 0) + ppmgrdevice->hdr.data.super.obj_mask.super.data[0]) == 0) { return -EINVAL; + } *ppboardobjpmudata = (struct nv_pmu_boardobj *) &ppmgrdevice->devices[idx].data.board_obj; @@ -99,8 +100,9 @@ static struct boardobj *construct_pwr_device(struct gk20a *g, status = boardobj_construct_super(g, &board_obj_ptr, pargs_size, pargs); - if (status) + if (status) { return NULL; + } pwrdev = (struct pwr_device_ina3221*)board_obj_ptr; @@ -250,8 +252,9 @@ static int devinit_get_pwr_device_table(struct gk20a *g, pwr_device_data.ina3221.curr_correct_m = (1 << 12); } pwr_device_size = sizeof(struct pwr_device_ina3221); - } else + } else { continue; + } pwr_device_data.boardobj.type = CTRL_PMGR_PWR_DEVICE_TYPE_INA3221; pwr_device_data.pwrdev.power_rail = (u8)0; @@ -306,8 +309,9 @@ int pmgr_device_sw_setup(struct gk20a *g) pboardobjgrp->pmudatainstget = _pwr_device_pmudata_instget; status = devinit_get_pwr_device_table(g, ppwrdeviceobjs); - if (status) + if (status) { goto done; + } done: nvgpu_log_info(g, " done status %x", status); -- cgit v1.2.2