From c6cfb12d91accc759ed80985573014df89d9cdaa Mon Sep 17 00:00:00 2001 From: Sai Nikhil Date: Tue, 11 Sep 2018 10:38:54 +0530 Subject: gpu: nvgpu: pmgr: fix MISRA Rule 10.4 Violations MISRA Rule 10.4 only allows the usage of arithmetic operations on operands of the same essential type category. Adding "U" at the end of the integer literals to have same type of operands when an arithmetic operation is performed. This fixes violation where an arithmetic operation is performed on signed and unsigned int types. JIRA NVGPU-992 Change-Id: Id3b2c8ea1af1807087468c6978abfbfc85bee2ec Signed-off-by: Sai Nikhil Reviewed-on: https://git-master.nvidia.com/r/1809757 Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/pmgr/pwrmonitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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 28074afb..710ae85b 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c +++ b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c @@ -40,7 +40,7 @@ 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]) == 0U) { return -EINVAL; } @@ -67,7 +67,7 @@ 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]) == 0U) { return -EINVAL; } @@ -241,7 +241,7 @@ static int devinit_get_pwr_topology_table(struct gk20a *g, memcpy(&pwr_topology_table_entry.param0, (curr_pwr_topology_table_ptr + 2), - (VBIOS_POWER_TOPOLOGY_2X_ENTRY_SIZE_16 - 2)); + (VBIOS_POWER_TOPOLOGY_2X_ENTRY_SIZE_16 - 2U)); class_type = (u8)BIOS_GET_FIELD( pwr_topology_table_entry.flags0, -- cgit v1.2.2