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/pwrmonitor.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pwrmonitor.c') diff --git a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c index 53c7a1c4..9b2f91de 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c +++ b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c @@ -40,8 +40,9 @@ static int _pwr_channel_pmudata_instget(struct gk20a *g, /*check whether pmuboardobjgrp has a valid boardobj in index*/ if (((u32)BIT(idx) & - ppmgrchannel->hdr.data.super.obj_mask.super.data[0]) == 0) + ppmgrchannel->hdr.data.super.obj_mask.super.data[0]) == 0) { return -EINVAL; + } *ppboardobjpmudata = (struct nv_pmu_boardobj *) &ppmgrchannel->channels[idx].data.board_obj; @@ -66,8 +67,9 @@ static int _pwr_channel_rels_pmudata_instget(struct gk20a *g, /*check whether pmuboardobjgrp has a valid boardobj in index*/ if (((u32)BIT(idx) & - ppmgrchrels->hdr.data.super.obj_mask.super.data[0]) == 0) + ppmgrchrels->hdr.data.super.obj_mask.super.data[0]) == 0) { return -EINVAL; + } *ppboardobjpmudata = (struct nv_pmu_boardobj *) &ppmgrchrels->ch_rels[idx].data.board_obj; @@ -150,8 +152,9 @@ static struct boardobj *construct_pwr_topology(struct gk20a *g, status = boardobj_construct_super(g, &board_obj_ptr, pargs_size, pargs); - if (status) + if (status) { return NULL; + } pwrchannel = (struct pwr_channel_sensor*)board_obj_ptr; @@ -253,8 +256,9 @@ static int devinit_get_pwr_topology_table(struct gk20a *g, NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_PARAM1_SENSOR_PROVIDER_INDEX); pwr_topology_size = sizeof(struct pwr_channel_sensor); - } else + } else { continue; + } /* Initialize data for the parent class */ pwr_topology_data.boardobj.type = CTRL_PMGR_PWR_CHANNEL_TYPE_SENSOR; @@ -345,12 +349,14 @@ int pmgr_monitor_sw_setup(struct gk20a *g) ppwrmonitorobjs = &(g->pmgr_pmu.pmgr_monitorobjs); status = devinit_get_pwr_topology_table(g, ppwrmonitorobjs); - if (status) + if (status) { goto done; + } status = _pwr_channel_state_init(g); - if (status) + if (status) { goto done; + } /* Initialise physicalChannelMask */ g->pmgr_pmu.pmgr_monitorobjs.physical_channel_mask = 0; -- cgit v1.2.2