diff options
author | Sai Nikhil <snikhil@nvidia.com> | 2018-09-11 01:08:54 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-27 02:35:37 -0400 |
commit | c6cfb12d91accc759ed80985573014df89d9cdaa (patch) | |
tree | 0bc9f467e0f52732a9d5916cb804b12b8f00134b /drivers/gpu/nvgpu/pmgr/pwrdev.c | |
parent | c18c8b5b28b839ac20ae2c4b1003e9b44199016a (diff) |
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 <snikhil@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1809757
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pwrdev.c')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pwrdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pwrdev.c b/drivers/gpu/nvgpu/pmgr/pwrdev.c index cf45f723..c1bf0844 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrdev.c +++ b/drivers/gpu/nvgpu/pmgr/pwrdev.c | |||
@@ -40,7 +40,7 @@ static int _pwr_device_pmudata_instget(struct gk20a *g, | |||
40 | 40 | ||
41 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ | 41 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ |
42 | if (((u32)BIT(idx) & | 42 | if (((u32)BIT(idx) & |
43 | ppmgrdevice->hdr.data.super.obj_mask.super.data[0]) == 0) { | 43 | ppmgrdevice->hdr.data.super.obj_mask.super.data[0]) == 0U) { |
44 | return -EINVAL; | 44 | return -EINVAL; |
45 | } | 45 | } |
46 | 46 | ||
@@ -191,7 +191,7 @@ static int devinit_get_pwr_device_table(struct gk20a *g, | |||
191 | 191 | ||
192 | memcpy(&pwr_sensor_table_entry.class_param0, | 192 | memcpy(&pwr_sensor_table_entry.class_param0, |
193 | (curr_pwr_device_table_ptr + 1), | 193 | (curr_pwr_device_table_ptr + 1), |
194 | (VBIOS_POWER_SENSORS_2X_ENTRY_SIZE_15 - 1)); | 194 | (VBIOS_POWER_SENSORS_2X_ENTRY_SIZE_15 - 1U)); |
195 | 195 | ||
196 | device_type = (u8)BIOS_GET_FIELD( | 196 | device_type = (u8)BIOS_GET_FIELD( |
197 | pwr_sensor_table_entry.flags0, | 197 | pwr_sensor_table_entry.flags0, |