mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: gk20a: fix MISRA 10.4 Violations [1/2]
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: Ifb8cb992a5cb9b04440f162918a8ed2ae17ec928 Signed-off-by: Sai Nikhil <snikhil@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1822587 GVS: Gerrit_Virtual_Submit Reviewed-by: Adeel Raza <araza@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
999eabbcd7
commit
94e00ab6ad
@@ -1611,7 +1611,8 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
|
||||
struct gr_zcull_info *zcull_info;
|
||||
struct zbc_entry *zbc_val;
|
||||
struct zbc_query_params *zbc_tbl;
|
||||
int i, err = 0;
|
||||
int err = 0;
|
||||
u32 i;
|
||||
|
||||
nvgpu_log_fn(g, "start %d", _IOC_NR(cmd));
|
||||
|
||||
@@ -1683,7 +1684,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
|
||||
|
||||
switch (zbc_val->type) {
|
||||
case GK20A_ZBC_TYPE_COLOR:
|
||||
for (i = 0; i < GK20A_ZBC_COLOR_VALUE_SIZE; i++) {
|
||||
for (i = 0U; i < GK20A_ZBC_COLOR_VALUE_SIZE; i++) {
|
||||
zbc_val->color_ds[i] = set_table_args->color_ds[i];
|
||||
zbc_val->color_l2[i] = set_table_args->color_l2[i];
|
||||
}
|
||||
@@ -1723,7 +1724,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
|
||||
if (!err) {
|
||||
switch (zbc_tbl->type) {
|
||||
case GK20A_ZBC_TYPE_COLOR:
|
||||
for (i = 0; i < GK20A_ZBC_COLOR_VALUE_SIZE; i++) {
|
||||
for (i = 0U; i < GK20A_ZBC_COLOR_VALUE_SIZE; i++) {
|
||||
query_table_args->color_ds[i] = zbc_tbl->color_ds[i];
|
||||
query_table_args->color_l2[i] = zbc_tbl->color_l2[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user