gpu: nvgpu: fix MISRA 5.3 violations

Fix violations of MISRA 5.3 introduced by updated implementation of
nvgpu_timeout_expired with recent logging changes.

kernel/nvgpu/drivers/gpu/nvgpu/common/falcon/falcon.c:101
  Checker: MISRA C-2012 Rule 5.3 (Required)

kernel/nvgpu/drivers/gpu/nvgpu/common/falcon/falcon.c:101:
  1. misra_c_2012_rule_5_3_violation: Declaration with identifier "ret"
hides another declaration.
kernel/nvgpu/drivers/gpu/nvgpu/common/falcon/falcon.c:101:
  2. hidden_declaration: This declaration of "ret" is hidden.

JIRA NVGPU-4283

Change-Id: I8932cf84efaf0652f10e66ab174e24548a91c143
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2222414
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sagar Kamble
2019-10-21 14:28:25 +05:30
committed by Alex Waterman
parent 382a0841b5
commit 72fc890f51

View File

@@ -47,15 +47,15 @@
#define nvgpu_timeout_expired_msg_cpu(timeout, caller, fmt, arg...) \
({ \
struct nvgpu_timeout *t_ptr = (timeout); \
int ret = 0; \
int ret_cpu = 0; \
if (nvgpu_current_time_ns() > t_ptr->time) { \
if ((t_ptr->flags & NVGPU_TIMER_SILENT_TIMEOUT) == 0U) { \
nvgpu_err(t_ptr->g, "Timeout detected @ %p" fmt, \
caller, ##arg); \
} \
ret = -ETIMEDOUT; \
ret_cpu = -ETIMEDOUT; \
} \
(int)ret; \
(int)ret_cpu; \
})
/**
@@ -76,17 +76,17 @@
#define nvgpu_timeout_expired_msg_retry(timeout, caller, fmt, arg...) \
({ \
struct nvgpu_timeout *t_ptr = (timeout); \
int ret = 0; \
int ret_retry = 0; \
if (t_ptr->retries.attempted >= t_ptr->retries.max_attempts) { \
if ((t_ptr->flags & NVGPU_TIMER_SILENT_TIMEOUT) == 0U) { \
nvgpu_err(t_ptr->g, "No more retries @ %p" fmt, \
caller, ##arg); \
} \
ret = -ETIMEDOUT; \
ret_retry = -ETIMEDOUT; \
} else { \
t_ptr->retries.attempted++; \
} \
(int)ret; \
(int)ret_retry; \
})
/**
@@ -105,15 +105,15 @@
*/
#define nvgpu_timeout_expired_msg_impl(timeout, caller, fmt, arg...) \
({ \
int ret = 0; \
int ret_timeout = 0; \
if (((timeout)->flags & NVGPU_TIMER_RETRY_TIMER) != 0U) { \
ret = nvgpu_timeout_expired_msg_retry((timeout), caller,\
fmt, ##arg); \
ret_timeout = nvgpu_timeout_expired_msg_retry((timeout),\
caller, fmt, ##arg); \
} else { \
ret = nvgpu_timeout_expired_msg_cpu((timeout), caller, \
fmt, ##arg); \
ret_timeout = nvgpu_timeout_expired_msg_cpu((timeout), \
caller, fmt, ##arg); \
} \
(int)ret; \
(int)ret_timeout; \
})
#endif